Advertisement

You have an error in your SQL syntax;

Need help upgrading your Joomla! website or converting to Joomla! 3.x?

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
entropik
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Thu Aug 29, 2013 9:01 pm

You have an error in your SQL syntax;

Post by entropik » Wed Jul 13, 2016 2:24 pm

I got following error when I am trying to update joomla.

1064 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 '' at line 1 SQL=UPDATE `uh9nw_update_sites` SET `last_check_timestamp`='0',`location`='http://update.joomla.org/core/sts/list_sts.xml' WHERE

anyone knows the solution?

Thanks.

Advertisement
itoctopus
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4025
Joined: Mon Nov 25, 2013 4:35 pm
Location: Montreal, Canada
Contact:

Re: You have an error in your SQL syntax;

Post by itoctopus » Wed Jul 13, 2016 2:43 pm

It might be that an Akeeba bug has accidentally removed your "Update Sites". See: https://www.akeebabackup.com/home/news/ ... sites.html
http://www.itoctopus.com - Joomla consulting at its finest
https://twitter.com/itoctopus - Follow us on Twitter

User avatar
OldMoldy
Joomla! Intern
Joomla! Intern
Posts: 52
Joined: Sat Jan 30, 2010 11:19 pm

Re: You have an error in your SQL syntax;

Post by OldMoldy » Thu Jul 14, 2016 5:59 pm

I have the same error trying to update from Joomla 3.5.1 to Joomla 3.6.0 (not release candidate). I am using Akeeba backup core 5.1.2

User avatar
coaleb
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 185
Joined: Fri Mar 16, 2012 11:40 pm
Location: California
Contact:

Re: You have an error in your SQL syntax;

Post by coaleb » Thu Jul 14, 2016 6:20 pm

Unfortunately I don't have a solution for you, but I do have a small piece of advice: when including a MySQL statement in a post on this forum, you should never use your actual database prefix (e.g. uh9nw_), instead replace it with something like "#__" or "pre_". This prefix is unique to your site and helps secure it from database hacking attempts.

Also, you left out some potentially important information:
  • What happens after the "WHERE" in your MySQL statement?
  • What version of Joomla are you ugrading from and to?
  • DId the update succeed, or did this error stop it?
  • What environment is your site installed on (PHP version, MySQL version, etc)?
Things like this might better help someone on this forum to better understand your problem and provide useful advice.

Best of luck!
Best Regards,
Brian Coale
Simpl Extensions: http://extensions.joomla.org/extensions ... play/24407

User avatar
OldMoldy
Joomla! Intern
Joomla! Intern
Posts: 52
Joined: Sat Jan 30, 2010 11:19 pm

Re: You have an error in your SQL syntax;

Post by OldMoldy » Thu Jul 14, 2016 10:20 pm

Current Joomla version 3.5.1 upgrading to 3.6.0
MySQL: Server version: 5.5.50-cll - MySQL Community Server (GPL), Protocol version: 10
Database client version: libmysql - 5.1.73
PHP Version 5.6.23

The SQL statement shown is:

SQL=UPDATE `#__update_sites` SET `last_check_timestamp`='0',`location`='http://update.joomla.org/core/list.xml' WHERE

The Joomla Update process stopped with this error.

When I set the server options to debug, the following added information is available:

*An error has occurred.**

1064 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 '' at line 1 SQL=UPDATE `hh9dx_update_sites` SET `last_check_timestamp`='0',`location`='http://update.joomla.org/core/list.xml' WHERE

Call stack
# Function Location
1 JApplicationCms->execute() /home/wavey/public_html/administrator/index.php:51
2 JApplicationAdministrator->doExecute() /home/wavey/public_html/libraries/cms/application/cms.php:257
3 JApplicationAdministrator->dispatch() /home/wavey/public_html/libraries/cms/application/administrator.php:152
4 JComponentHelper::renderComponent() /home/wavey/public_html/libraries/cms/application/administrator.php:98
5 JComponentHelper::executeComponent() /home/wavey/public_html/libraries/cms/component/helper.php:380
6 require_once() /home/wavey/public_html/libraries/cms/component/helper.php:405
7 JControllerLegacy->execute() /home/wavey/public_html/administrator/components/com_joomlaupdate/joomlaupdate.php:18
8 JoomlaupdateController->display() /home/wavey/public_html/libraries/legacy/controller/legacy.php:728
9 JoomlaupdateModelDefault->applyUpdateSite() /home/wavey/public_html/administrator/components/com_joomlaupdate/controller.php:49
10 JDatabaseDriver->updateObject() /home/wavey/public_html/administrator/components/com_joomlaupdate/models/default.php:89
11 JDatabaseDriverMysql->execute() /home/wavey/public_html/libraries/joomla/database/driver.php:2279

**Return to Control Panel**

itoctopus
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4025
Joined: Mon Nov 25, 2013 4:35 pm
Location: Montreal, Canada
Contact:

Re: You have an error in your SQL syntax;

Post by itoctopus » Thu Jul 14, 2016 10:33 pm

Have you had the chance to check that Akeeba post I linked to in my first reply? I believe it solves the problem.
http://www.itoctopus.com - Joomla consulting at its finest
https://twitter.com/itoctopus - Follow us on Twitter

sovainfo
Joomla! Exemplar
Joomla! Exemplar
Posts: 8808
Joined: Sat Oct 01, 2011 7:06 pm

Re: You have an error in your SQL syntax;

Post by sovainfo » Thu Jul 14, 2016 11:22 pm

What does Extensions->Update Sites report for Core?
Suggest to change location using phpMyAdmin.
Issue with migrating? Include logs/joomla_update.php in your report!
Blank screen? Verify pagesource for HTML code (javascript error)
Installation failing on populating database? Install with set_time_limit(0)
Document your customizations!

User avatar
OldMoldy
Joomla! Intern
Joomla! Intern
Posts: 52
Joined: Sat Jan 30, 2010 11:19 pm

Re: You have an error in your SQL syntax;

Post by OldMoldy » Fri Jul 15, 2016 2:55 am

Thanks for the earlier post, itoctopus, that was the problem.

User avatar
coaleb
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 185
Joined: Fri Mar 16, 2012 11:40 pm
Location: California
Contact:

Re: You have an error in your SQL syntax;

Post by coaleb » Fri Jul 15, 2016 3:39 pm

If the MySQL statement ends with 'WHERE', and there are no WHERE conditions, that's probably why you were getting that syntax error. If the Akeeba bug wiped out your update sites, my guess would be that Joomla would usually put the ID of the Joomla Core update site after that WHERE statement, but since that ID didn't exist, it left it blank, which caused your syntax error.

Hope everyone got it sorted!
Best Regards,
Brian Coale
Simpl Extensions: http://extensions.joomla.org/extensions ... play/24407

ADMadmin
Joomla! Apprentice
Joomla! Apprentice
Posts: 47
Joined: Sat Sep 26, 2015 8:25 pm

Re: You have an error in your SQL syntax;

Post by ADMadmin » Fri Jul 15, 2016 4:24 pm

I too am having the same issue and have been to the Akeeba site, read their directions, loaded their fix, uploaded to our site and repaired. No change. I opened our PHP MyAdmin, changed the timestamp and location URL for the update line and still getting the 1024 error. Any solutions?

User avatar
coaleb
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 185
Joined: Fri Mar 16, 2012 11:40 pm
Location: California
Contact:

Re: You have an error in your SQL syntax;

Post by coaleb » Fri Jul 15, 2016 8:03 pm

Error 1024 is very different than error 1064. 1064 is a parsing error (e.g. syntax error), whereas 1024 is a read file error. If you have a 1024 error the solution in this post will not work for you. Your best best might be to start a new post giving as much detail about your problem as possible. Be sure to include your version of Joomla, PHP, MySQL and any extensions you think might be related to the problem.
Best Regards,
Brian Coale
Simpl Extensions: http://extensions.joomla.org/extensions ... play/24407

Advertisement

Locked

Return to “Migrating and Upgrading to Joomla! 3.x”