Unable to perform sql

Everything related to Hesk - helpdesk software

Moderator: mkoch227

Post Reply
alfiosantoro
Posts: 7
Joined: Mon Dec 09, 2019 2:36 pm

Unable to perform sql

Post by alfiosantoro »

Hi, when I try to merge two tickets created by email, this error is returned:

SELECT COUNT(*) as `cnt`, (CASE WHEN `staffid` = 0 THEN 0 ELSE 1 END) AS `staffcnt` FROM `hesk_replies` WHERE `replyto`=35 GROUP BY `staffcnt` ASC

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ASC' at line 1

What can this problem be due to?

Thank you,

A. Santoro
Klemen
Site Admin
Posts: 10136
Joined: Fri Feb 11, 2005 4:04 pm

Re: Unable to perform sql

Post by Klemen »

Could you let me know what version of Hesk and MySQL you are using (check in Hesk admin panel on Settings page)?
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
alfiosantoro
Posts: 7
Joined: Mon Dec 09, 2019 2:36 pm

Re: Unable to perform sql

Post by alfiosantoro »

Hi,

thank you for the support.

HESK version: 2.8.4 - HESK is up to date
PHP version: 7.3.7 (MySQLi)
MySQL version: 8.0.18
/hesk_settings.inc.php Exists, Writable
/attachments Exists, Writable
/cache Exists, Writable
Klemen
Site Admin
Posts: 10136
Joined: Fri Feb 11, 2005 4:04 pm

Re: Unable to perform sql

Post by Klemen »

It appears MySQL 8 introduced some backward-incompatible changes when sorting group by clauses. Thank you for bringing this to my attention.

I will look into it more deeply in the following weeks and update you when I have a solution.
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
Klemen
Site Admin
Posts: 10136
Joined: Fri Feb 11, 2005 4:04 pm

Re: Unable to perform sql

Post by Klemen »

Please try this and see if it fixes your problem:
1. download this archive
2. upload the "admin_functions.inc.php" to your Hesk "inc" folder (overwrite the existing file)
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
alfiosantoro
Posts: 7
Joined: Mon Dec 09, 2019 2:36 pm

Re: Unable to perform sql

Post by alfiosantoro »

Hi Klemen,

replacing the file you provided to me now everything works!

Thanks for your help, greetings,

Alfio
Post Reply