MySQL Forums
Forum List  »  PHP

Problems with Character Sets (cp1251) on PHP4 and mysql 4.1.18
Posted by: Nick
Date: April 05, 2006 12:15AM

I have problems with cyrillic character sets in the the mysql databases (smth this ???????????).
I have found how to fix this problem. It is a sending of additional query.

function mysql_connection ()
{
Global $host,$user,$pass;

if(!$dbc=@mysql_connect("$host","$user","$pass")){

mysql_query("SET NAMES cp1251");

return $dbc;
}


But sometimes it does not work (if connecting was lost or was much queries to database). My hosting has _ENV["LANG"] en_US.UTF-8 and mysql 4.1.18, PHP4.
1) Do you know another way how I can work with Cyrillic Character Sets (cp1251) without sending of additional query?
2) Is there way to set the configuration for work mysql with cp1251 from .htaccess because I have not access to php.ini and my.ini files on hosting?

Options: ReplyQuote


Subject
Written By
Posted
Problems with Character Sets (cp1251) on PHP4 and mysql 4.1.18
April 05, 2006 12:15AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.