Cannot run SQL query

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
bim
Posts: 4
Joined: Fri Mar 09, 2012 8:28 am

Cannot run SQL query

Post 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
Klemen
Site Admin
Posts: 10136
Joined: Fri Feb 11, 2005 4:04 pm

Re: Cannot run SQL query

Post 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?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
bim
Posts: 4
Joined: Fri Mar 09, 2012 8:28 am

Re: Cannot run SQL query

Post 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
Klemen
Site Admin
Posts: 10136
Joined: Fri Feb 11, 2005 4:04 pm

Re: Cannot run SQL query

Post 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.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
bim
Posts: 4
Joined: Fri Mar 09, 2012 8:28 am

Re: Cannot run SQL query

Post 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´ ");
Klemen
Site Admin
Posts: 10136
Joined: Fri Feb 11, 2005 4:04 pm

Re: Cannot run SQL query

Post 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
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
bim
Posts: 4
Joined: Fri Mar 09, 2012 8:28 am

Re: Cannot run SQL query

Post by bim »

Thank you. now it works
Klemen
Site Admin
Posts: 10136
Joined: Fri Feb 11, 2005 4:04 pm

Re: Cannot run SQL query

Post by Klemen »

Could you let me know which of the above solutions worked for you?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Post Reply