Page 1 of 1
Error: Can't execute SQL
Posted: Fri Sep 12, 2025 8:24 am
by chrisdevelop
Script URL:
Version of script: 364
Hosting company: Certa Hosting
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:
Write your message below:
On one of our sites we have a sub directory that holds the hesk program 343 version, we downloaded the upgrade from 343 to 364.
We followed the instructions to the letter. I have checked and we are running PHP version 8.1 we did a backup first.
We uploaded the new version as instructed but when we go to log in we are getting Error: Can't execute SQL
Neither us or our hosting company knows why this is happening, and asked if it was to do with the configuration file which is only used for our main program. It has never affected any hesk program before. Also I have checked the hesk settings both on the old backup and the new version and they are the same.
Can anyone give any idea why it wont connect i.e. Error: Can't execute SQL
I have not mentioned what the sub folder is for and details as it would expose data to the public.
Re: Error: Can't execute SQL
Posted: Fri Sep 12, 2025 10:26 am
by Klemen
To get more info about what is happening try this:
1. backup existing files
2. download hesk_settings.inc.php
3. open it in a powerful text editor, such as Notepad++
4. change
to
5. save, upload and test
The error message should now give more details.
Re: Error: Can't execute SQL
Posted: Fri Sep 12, 2025 12:39 pm
by chrisdevelop
This is what it shows with debug on.
Error: Can't execute SQL: SELECT `title`, `message`, `style` FROM `hesk_service_messages` WHERE `type`='0' AND (`location` IS NULL OR `location`='ALL' OR `location` LIKE '%home%') AND (`language` IS NULL OR `language` LIKE 'English') ORDER BY `order` ASC
MySQL said:
Unknown column 'location' in 'where clause'
Re: Error: Can't execute SQL
Posted: Fri Sep 12, 2025 2:23 pm
by Klemen
This means your database hasn't been converted from 3.4.x (at least not fully or properly).
Did you run the /install script during the upgrade and complete the process?
Do you have a "hesk_customers" table in the database? How about a "hesk_ticket_to_collaborator" one?
Re: Error: Can't execute SQL
Posted: Fri Sep 12, 2025 2:36 pm
by chrisdevelop
Yes I followed the instructions to the letter. Install script was run and completed.
There are customers in the database and the tickets would have the ID and ticket no against each customer prior to upgrade.
Re: Error: Can't execute SQL
Posted: Fri Sep 12, 2025 2:41 pm
by Klemen
I don't understand - there were no hesk_customers and hesk_ticket_to_collaborator tables in version 3.4.3, how could they be there before the upgrade?
Perhaps you ran an upgrade, restored a backup and ran another update? If this is the case, then:
- delete ALL hesk tables from the database
- restore the backup
- run the update script again
Re: Error: Can't execute SQL
Posted: Fri Sep 12, 2025 3:04 pm
by chrisdevelop
No there was no hesk_ticket_to_collaborator in the 343 version, i did delete all the files and SQL as well and had the backup restored, then tried again with the upgrade.
Re: Error: Can't execute SQL
Posted: Fri Sep 12, 2025 3:11 pm
by Klemen
Are you able to share the structure of your entire hesk database (SQL export - structure only, no data), in private?
Re: Error: Can't execute SQL
Posted: Fri Sep 12, 2025 3:39 pm
by chrisdevelop
i can do an export and send you the whole sql i would not want to post on here though
Re: Error: Can't execute SQL
Posted: Fri Sep 12, 2025 3:44 pm
by Klemen
Feel free to do it in a private message (or upload somewhere and send me the link in a PM).
Re: Error: Can't execute SQL
Posted: Fri Sep 12, 2025 4:42 pm
by chrisdevelop
sent PM with link
Re: Error: Can't execute SQL
Posted: Fri Sep 12, 2025 5:05 pm
by Klemen
The database you have sent is on version 3.4, not on version 3.6
You will need to:
1. Download Hesk 3.6.4 files
2. Upload the "install" folder to your server
3. Run the installation script (yourwebsite.com/hesk/install), select "Upgrade", then complete all the steps of the process
4. Delete the "install" folder
If this doesn't change anything, an old install may be cached on the server. In this case:
1. Contact your hosting company and ask them to disable any server-side caching for your help desk
2. Repeat the above process when they do
Re: Error: Can't execute SQL
Posted: Fri Sep 12, 2025 5:23 pm
by chrisdevelop
Thank you so very much its worked, I am so grateful
Thank you