byte001 Posted November 28, 2006 Share Posted November 28, 2006 i cant figure out why im getting this 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 '-9, 9' at line 1select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from products p, products_description pd, specials s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '1' and s.status = '1' order by s.specials_date_added DESC limit -9, 9[code]$specials_query_raw = "select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added DESC"; $specials_split = new splitPageResults($specials_query_raw, MAX_DISPLAY_SPECIAL_PRODUCTS);[/code]thx in advance Quote Link to comment https://forums.phpfreaks.com/topic/28787-error-1064/ Share on other sites More sharing options...
btherl Posted November 29, 2006 Share Posted November 29, 2006 "limit -9,9" means "Start from offset -9, and return 9 objects". That doesn't make any sense. The offset must be 0 or greater. Whichever code adds that "limit -9,9" is causing the problem. Quote Link to comment https://forums.phpfreaks.com/topic/28787-error-1064/#findComment-131987 Share on other sites More sharing options...
fenway Posted November 29, 2006 Share Posted November 29, 2006 Yeah, they removed the ability to have negative limits a while back... makes some things annoying, but in this case, it makes no sense. Quote Link to comment https://forums.phpfreaks.com/topic/28787-error-1064/#findComment-132089 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.