Error: Can't execute SQL

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
chrisdevelop
Posts: 23
Joined: Thu Feb 01, 2018 2:27 pm

Error: Can't execute SQL

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

Re: Error: Can't execute SQL

Post 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

Code: Select all

$hesk_settings['debug_mode']=0;
to

Code: Select all

$hesk_settings['debug_mode']=1;
5. save, upload and test

The error message should now give more details.
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
chrisdevelop
Posts: 23
Joined: Thu Feb 01, 2018 2:27 pm

Re: Error: Can't execute SQL

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

Re: Error: Can't execute SQL

Post 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?
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
chrisdevelop
Posts: 23
Joined: Thu Feb 01, 2018 2:27 pm

Re: Error: Can't execute SQL

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

Re: Error: Can't execute SQL

Post 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
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
chrisdevelop
Posts: 23
Joined: Thu Feb 01, 2018 2:27 pm

Re: Error: Can't execute SQL

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

Re: Error: Can't execute SQL

Post by Klemen »

Are you able to share the structure of your entire hesk database (SQL export - structure only, no data), in private?
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
chrisdevelop
Posts: 23
Joined: Thu Feb 01, 2018 2:27 pm

Re: Error: Can't execute SQL

Post by chrisdevelop »

i can do an export and send you the whole sql i would not want to post on here though
Klemen
Site Admin
Posts: 10211
Joined: Fri Feb 11, 2005 4:04 pm

Re: Error: Can't execute SQL

Post by Klemen »

Feel free to do it in a private message (or upload somewhere and send me the link in a PM).
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
chrisdevelop
Posts: 23
Joined: Thu Feb 01, 2018 2:27 pm

Re: Error: Can't execute SQL

Post by chrisdevelop »

sent PM with link
Klemen
Site Admin
Posts: 10211
Joined: Fri Feb 11, 2005 4:04 pm

Re: Error: Can't execute SQL

Post 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
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
chrisdevelop
Posts: 23
Joined: Thu Feb 01, 2018 2:27 pm

Re: Error: Can't execute SQL

Post by chrisdevelop »

Thank you so very much its worked, I am so grateful

Thank you
Post Reply