Forum Replies Created
-
AuthorPosts
-
NickMemberpeterlaursen wrote on Jan 26 2006, 11:47 PM:From where will you have to run that?
From your own script(s)? Do I understand correctly?
I run it at the top of the php page that I have written. SET NAMES does seem to work ok on both my local setup and on the live site:
Code:ob_start();dl(“mysql.dll”);
$link = mysql_connect('hostname', 'user', 'pw');
if (!$link) {
die('Sorry, could not connect to DB: ' . mysql_error());
}
$db_selected = mysql_select_db('db name', $link);
if (!$db_selected) {
die ('Can't use foo : ' . mysql_error());
}
$sql = 'SET NAMES latin5;';
mysql_query($sql, $link);?>
etc…I think the command sets the character set and collation for the current connection:
http://dev.mysql.com/doc/refman/5.0/en/cha…connection.html
Whether or not this is the best way to do things or not I'm not sure, seemd to work for me though…
Nick
NickMemberThanks for taking the time to look into this problem,
Quote:Can you work with Turkish characters on your local server?Yes, I don't seem to have any problems locally. My local mySQL is 4.1.16
Quote:Do you have any experience with PHP and Turkish characters?Actually, this is my first PHP project. I normally use ASP. I have a copy of this current project running locally PHP on IIS and it is running ok. To get the Turkish display properly, I do have to run:
Code:$sql = 'SET NAMES latin5;';
mysql_query($sql, $link);Also if get Turkish into the db hosted with my ISP, using the the phpMyAdmin tool they provide Turkish is retrieved from the DB ok:
http://www.bursakilisesi.com/test.php
So it would seem that the db is working ok.
Nick
NickMemberHi Peter,
Thanks for your comments… THe host in question is a Turkish host based in Istanbul: http://www.kriweb.com. I too am in Turkey.
I've just tried it on my own local mysql and I can run a query fine connecting normally via localhost/3306 but if I http tunnel, I get the error.
The other thing I noticed is that if I paste Turkish direct from notepad into sqlYog it transforms all my turkish chatacters into the closest English char. i.e. a s with cedila decome an s, an i with not dot gets a dot…
here are some Turkish chars: iİ ıI şŞ ğĞ öÖ çÇ üÜ
btw SQLyog is very cool – esp being free. I normaly do english language projects, but I'm working on this Turkish one at the mo…
Also, in my regional settings, Language for Non unicode programs is set to Turkish.
Thanks
Nick
-
AuthorPosts