1

I got this error when I'm trying a script.

mySQL query error: SELECT * FROM ibf_store_shopstock WHERE is_hidden='0' AND category=1 ORDER BY item_name ASC  LIMIT 0,

mySQL error: 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
mySQL error code: 
Date: Monday 23rd 2012f July 2012 05:37:44 PM`

This is odd, since the very same script I tried on my localhost (MySQL 5.5.14) works just fine, but when I try it on live server (MySQL 5.1.63), it results in this error. I thought there's no big difference between the MySQL version?

Anyway here is a part of the suspected script (it's quite long): http://pastebin.com/YaQwVPqT

4
  • So your query ends with comma? Commented Jul 23, 2012 at 10:53
  • @zerkms: I'm not sure, it's from the PHP script. It's in here: pastebin.com/YaQwVPqT Commented Jul 23, 2012 at 10:57
  • well - it's your job, so make some research and show us the exact query that fails Commented Jul 23, 2012 at 10:58
  • Ah yes indeed, I've found the problem. Thanks a lot. Commented Jul 23, 2012 at 11:01

1 Answer 1

1

I think you are missing something after LIMIT clause "LIMIT start_record", "offset"

try

SELECT * 
FROM   ibf_store_shopstock 
WHERE is_hidden='0' AND 
      category=1 
ORDER BY item_name ASC  
LIMIT 0, 10;
Sign up to request clarification or add additional context in comments.

2 Comments

Hmm... so what should I edit in the PHP script? If you don't mind to check it out here: pastebin.com/YaQwVPqT
Wait, nevermind. I've found it. I indeed missed that something after the LIMIT clause. Thanks a lot!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.