Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

1064 - You have an error in your SQL syntax;


Recommended Posts

Hi guys,


Would appreciate your help...


On our recently installed and configured OSCommerce(2.3.1)Shop works fine apart from our main page. In the footer of http://www.mydomain.com/catalog/index.php I get the following....


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 'MAX_DISPLAY_PRODUCTS_FIRST_PAGE' at line 1


select p.products_id, p.products_image, p.products_tax_class_id, pd.products_name, if(s.status, s.specials_new_products_price, p.products_price) as products_price from products p left join specials s on p.products_id = s.products_id, products_description pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '1' order by p.products_date_added desc limit MAX_DISPLAY_PRODUCTS_FIRST_PAGE




...I've looked through the support forums and found some articles referring to "catalog side and the admin side changing $offset to max($offset, 0) as the "official" fix." however my split_page_results.php pages are already appear configured with max($offset, 0), so I'm a little confused :S


Any help greatly appreciated.



Link to comment
Share on other sites

The problem is that MAX_DISPLAY_PRODUCTS_FIRST_PAGE is not defined. It should be a small integer value. I don't have my code at hand to check, but I suspect that this is in a "settings" table in the database (name/value pairs) and is either outright missing, or has a bogus value. It should have been loaded into the database at installation. If not, you may be missing other settings, too.

Link to comment
Share on other sites

  • 1 year later...

If it's not in the DB configuration you can define it like this:




Maybe in /catalog/includes/languages/english/index.php

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.


"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -


"Headers already sent" - The definitive help


"Cannot redeclare ..." - How to find/fix it


SSL Implementation Help


Like this post? "Like" it again over there >

Link to comment
Share on other sites

That define does not appear to be in the vanilla osC 2.3.1 install. If an add-on is supposed to add it to the database, you forgot to run some sort of "update" script to update the database with it. Running it manually as above should do the trick, but you may still have other things that were overlooked.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...