moola Posted February 3, 2007 Share Posted February 3, 2007 SELECT i.*, u.username, u.email, g.gallery_name, CONCAT('http://tutaka.com/images/',u.username,'/', i.name, '.', type) AS image_url, CONCAT('http://tutaka.com/thumbs/',u.username,'/', i.name, '.jpg') AS thumb_url FROM images i LEFT OUTER JOIN galleries g ON i.gallery_id=g.gallery_id, users u WHERE i.user_id=u.user_id AND i.user_id=3 ORDER BY i.uploaded desc LIMIT -5,5 mySQL Says: 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 '-5,5' at line 1 I can't figure what the error is all about? Quote Link to comment https://forums.phpfreaks.com/topic/36860-sql-error-need-help/ Share on other sites More sharing options...
hvle Posted February 3, 2007 Share Posted February 3, 2007 Limit (# of item to be display)/offset so when you say LIMIT -5,5 You tell mysql to return -5 rows, which doesn't make sense. # of item to be display have to be a positive integer. Quote Link to comment https://forums.phpfreaks.com/topic/36860-sql-error-need-help/#findComment-175918 Share on other sites More sharing options...
fenway Posted February 5, 2007 Share Posted February 5, 2007 Yeah, you can't use negative offsets anymore... Quote Link to comment https://forums.phpfreaks.com/topic/36860-sql-error-need-help/#findComment-177202 Share on other sites More sharing options...
hvle Posted February 5, 2007 Share Posted February 5, 2007 anymore? does that mean mysql allowed negative offset before? fenway? This is interesting Quote Link to comment https://forums.phpfreaks.com/topic/36860-sql-error-need-help/#findComment-177213 Share on other sites More sharing options...
fenway Posted February 5, 2007 Share Posted February 5, 2007 I believe there was a time when you could use a negative offset -- so that you could start at record 20 but get _all_ of the rest of them... instead of what you currently have to do, which is specify a ridiculously large integer just to be sure. Quote Link to comment https://forums.phpfreaks.com/topic/36860-sql-error-need-help/#findComment-177300 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.