Zen Cart Logo
Forums / General Questions / PHP Fatal error: 1064:You have an error in your SQL syntax

PHP Fatal error: 1064:You have an error in your SQL syntax

Views: 5,187

Results 1 to 12 of 12
18 Apr 2012, 4:47 AM
#1
uswebworx avatar

uswebworx

Zen Follower

Join Date:
Sep 2006
Location:
USA
Posts:
297
Plugin Contributions:
0

PHP Fatal error: 1064:You have an error in your SQL syntax

URL to temp site is http://alsemergencylighting.com/cart/index.php?main_page=product_info&cPath=2_8&products_id=1

Admin>Configuration>My Store>Display Cart after Adding Product is set to true.

ZenLightbox was last mod installed and it was working. Went to eat supper and come back and it has died.
Configuration Files seem to be in order.

Debugging says:
PHP Fatal error: 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 'limit 10' at line 1 :: limit 10 in /home/alsemerg/public_html/cart/includes/classes/db/mysql/query_factory.php on line 101

However I have checked the file from the Tutorials section and everything is in order.

I am NOT on a Goddaddy server. I am on a linux server. I am confused!

Does it with default template as well. I have this same cart installed 3 separate times and ALL of them are giving "page not found" error.

18 Apr 2012, 6:44 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: PHP Fatal error: 1064:You have an error in your SQL syntax

You've got PHP files that are generating incorrect SQL statements.
So, you'll need to remove the changes that were made which caused the problem.

Good thing you have frequent regular consistent solid backups of everything.

http://www.zen-cart.com/wiki/index.php/Troubleshoot_-_Diagnosing_Obscure_Issues

And the error you're reporting would have nothing to do with being a GoDaddy server or not. No need to badmouth them when they're not involved in the situation

18 Apr 2012, 1:06 PM
#3
uswebworx avatar

uswebworx

Zen Follower

Join Date:
Sep 2006
Location:
USA
Posts:
297
Plugin Contributions:
0

Re: PHP Fatal error: 1064:You have an error in your SQL syntax

:smile:
Dr Byte how could this be, since the exact same thing is happening even on a fresh install I tried last night? I've since become frustrated and deleted all the stores except for /cart/ to start over and it still happens on a fresh install. Smells like a server issue to me. I've submitted a trouble ticket to my awesome support team
(not sarcasm) and will patiently wait for their answers.
See I am a typical man I despise asking for help! If I can't find the answer in this awesome forum then there isn't a a correct answer!
Thanks!

18 Apr 2012, 3:09 PM
#4
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: PHP Fatal error: 1064:You have an error in your SQL syntax

uswebworx:

:smile:
Dr Byte how could this be, since the exact same thing is happening even on a fresh install I tried last night?

If you've installed an add-on with bad code and re-install it with your 'fresh installs' you'll simply be re-installing the same erroneous files again, as such, the problem will persist.

If your 'fresh installs' were truely fresh, with no other addons the issue will almost certainly go away.

uswebworx:

Smells like a server issue to me.

As usual, I find myself agreeing with DrB, this doesn't sound anything like a server issue.

uswebworx:

I've submitted a trouble ticket to my awesome support team
(not sarcasm) and will patiently wait for their answers.

Whilst waiting I'd suggest that you continue to look for the real cause, because unless your support team know more about zencart than DrByte they probably aren't going to be of much help.

Cheers
Rod

18 Apr 2012, 8:28 PM
#5
uswebworx avatar

uswebworx

Zen Follower

Join Date:
Sep 2006
Location:
USA
Posts:
297
Plugin Contributions:
0

Re: PHP Fatal error: 1064:You have an error in your SQL syntax

Where would I begin looking?

18 Apr 2012, 8:35 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: PHP Fatal error: 1064:You have an error in your SQL syntax

looking for what?

18 Apr 2012, 8:42 PM
#7
uswebworx avatar

uswebworx

Zen Follower

Join Date:
Sep 2006
Location:
USA
Posts:
297
Plugin Contributions:
0

Re: PHP Fatal error: 1064:You have an error in your SQL syntax

You've got PHP files that are generating incorrect SQL statements.
So, you'll need to remove the changes that were made which caused the problem.

18 Apr 2012, 8:47 PM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: PHP Fatal error: 1064:You have an error in your SQL syntax

Under your public_html folder.

18 Apr 2012, 8:51 PM
#9
uswebworx avatar

uswebworx

Zen Follower

Join Date:
Sep 2006
Location:
USA
Posts:
297
Plugin Contributions:
0

Re: PHP Fatal error: 1064:You have an error in your SQL syntax

Really?
Thanks for the help.

Is this sarcasm or direct refusal to help cause I bashed Godaddy? I mean even in PM offering you money and turn your back on me. I asked a simple freaking question and you give a smart ###### answer...........I deserve to be treated as a human as I treated you and others here, I don't demand help from anyone. I know its under the public_html folder but actually for me it would be public_html/cart as I keep my files in order. My question maybe should be more specific for you, is this going to be on the admin side?

Thank you Master!

18 Apr 2012, 9:22 PM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: PHP Fatal error: 1064:You have an error in your SQL syntax

Your PM asking to hire me to fix your problem is completely irrelevant to this discussion and entirely unrelated to my response in PM or my reply posts here.

I've already explained what you need to do to find the offending non-core code that's causing you problems. http://www.zen-cart.com/wiki/index.php/Troubleshoot_-_Diagnosing_Obscure_Issues

Clearly you're using different code than original Zen Cart code, because there's nothing on line 101 of query_factory.php (in v1.5.0 and v1.3.9h) that could remotely cause the error message you're reporting.

As to whether to look under your admin folder or not ... well, that's not answerable given the limited information you've supplied.

You alone have all the access to all the files you need to evaluate. I've already given you my primary secrets for analysis and troubleshooting, via the link shared earlier.

18 Apr 2012, 9:28 PM
#11
uswebworx avatar

uswebworx

Zen Follower

Join Date:
Sep 2006
Location:
USA
Posts:
297
Plugin Contributions:
0

Re: PHP Fatal error: 1064:You have an error in your SQL syntax

Fixed!
Unsure of what or who did it but its working again

:wink:

19 Apr 2012, 8:17 AM
#12
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: PHP Fatal error: 1064:You have an error in your SQL syntax

uswebworx:

I mean even in PM offering you money and turn your back on me.

I'm not directing this just (or specifically) to you, but it is for all forums members to take note of.

Offering money is probably one of the worst things you can do around these parts.

We know the intentions are good, but most of us around here (especially the most prevalent participants and those most able to help with any given problem) do so because we enjoy helping people and we enjoy supporting ZenCart.

Trying to offer us a financial incentive to do what we enjoy doing is often considered both insulting and offensive.

Dare I say that it is almost akin to sax.... Something most people enjoy, and with a bit of sweet talking you'll get it for nothing, but an offer to pay for the service will just lead you to a slap on the face.. or worse..

Just something to keep in mind folks, and hopefully I haven't offended anyone with this comparison. (I'm hoping it'll also make a few people giggle) :)

Cheers
Rod