Page 1 of 1

Cannot run SQL query

Posted: Fri Mar 09, 2012 11:26 am
by bim
I get an error when I try to use the program in Turkish language. Can not run any SQL query I get an error when I try to enter a request from the fix

Re: Cannot run SQL query

Posted: Fri Mar 09, 2012 2:15 pm
by Klemen
But it works OK in English language?

What error do you get if you change

Code: Select all

$hesk_settings['debug_mode']=0;
to

Code: Select all

$hesk_settings['debug_mode']=1;
in file hesk_settings.inc.php?

Re: Cannot run SQL query

Posted: Fri Mar 09, 2012 2:52 pm
by bim
SQL sorgusu çalıştırılamıyor: INSERT INTO `hesk_tickets` ( `trackid`,`name`,`email`,`category`,`priority`,`subject`,`message`,`dt`,`lastchange`,`ip`,`status`,`owner`,`attachments`,`history`,`custom1`,`custom2`,`custom3`,`custom4`,`custom5`,`custom6`,`custom7`,`custom8`,`custom9`,`custom10`,`custom11`,`custom12`,`custom13`,`custom14`,`custom15`,`custom16`,`custom17`,`custom18`,`custom19`,`custom20` ) VALUES ( '8QX-7X6-32V3', 'Bilgi Islem Destek Birimi', 'bim@bim.com', '1', '3', 'ağğğ', 'sdfsdf', NOW(), NOW(), '192.168.5.55', '0', '1', '', '
2012-03-09 06:51:42 üzrinde otomatik olarak Your name (Administrator)\'e atandı
', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '' )

MySQL says that
Incorrect string value: '\xF0\xF0\xF0' for column 'subject' at row 1

Re: Cannot run SQL query

Posted: Fri Mar 09, 2012 7:15 pm
by Klemen
Your database isn't accepting ğ chars. Make sure your database tables are in correct encoding.

You can check and change encoding with a tool like phpMyAdmin - most hosts give access to phpMyAdmin in a control panel.

Re: Cannot run SQL query

Posted: Mon Mar 12, 2012 2:21 pm
by bim
where you need to write this code

mysql_select_db("veritabanı_adı");
mysql_query("SET NAMES ´latin5´");
mysql_query("SET CHARACTER SET latin5");
mysql_query("SET COLLATION_CONNECTION = ´latin5_turkish_ci´ ");

Re: Cannot run SQL query

Posted: Mon Mar 12, 2012 3:12 pm
by Klemen
Not sure which version of PHP and mySQL you are using.

If you have MySQL > 5.0.7 and PHP > 5.3.2 try in inc/databse.inc.php adding this

Code: Select all

mysql_set_charset('latin5',$hesk_db_link);
just ABOVE this

Code: Select all

if (@mysql_select_db($hesk_settings['db_name'], $hesk_db_link))
I you have lower versions of PHP/MySQL try changing

Code: Select all

    if (@mysql_select_db($hesk_settings['db_name'], $hesk_db_link))
    {

mysql_query("SET NAMES ´latin5´", $hesk_db_link);
mysql_query("SET CHARACTER SET latin5", $hesk_db_link);
mysql_query("SET COLLATION_CONNECTION = ´latin5_turkish_ci´ ", $hesk_db_link);

    	return $hesk_db_link;
into

Re: Cannot run SQL query

Posted: Mon Mar 12, 2012 9:16 pm
by bim
Thank you. now it works

Re: Cannot run SQL query

Posted: Tue Mar 13, 2012 4:22 pm
by Klemen
Could you let me know which of the above solutions worked for you?