0

Hi There;

I have a MS-SQL server and I have Turkish names in my table. User enters names and I send it to SQL server, print result to output. However, my PHP code process and prints text as a UTF-8, and send it to MS-SQL and print it to output.However data in MS-SQL is in Windows(Turkish) format, so there are nothing to return. For example;
when user types "Güray" in html input form, PHP issues a query:
"SELECT * FROM table WHERE name ='Güray' " and sends it to MS-SQL server. Server returns nothing, but I know that there are many entries that name attribute is 'Güray'.
But when name contains purely English characters, such as 'Ali' it works fine.

In addition, when I print result of query returned by MS-SQL via HTML , Turkish character in a string printed in a rectangle.

How can I overcome these two frustrating situations? Any help is greatly appreciated.

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by diafol
0

Ensure that your DB is charset utf8 and the collation is utf8_unicode_ci. That's in mysql, is assume it's simialr in mssql.

When I hit difficulties in mysql:

mysql_query('SET character_set_results=utf8');
	mysql_query('SET names=utf8');
	mysql_query('SET character_set_client=utf8');
	mysql_query('SET character_set_connection=utf8');
	mysql_query('SET character_set_results=utf8');
	mysql_query('SET collation_connection=utf8_unicode_ci');
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.