Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

1064 - You have an error in your SQL syntax near 'MAX_DISPLA


Guest

Recommended Posts

I did two separate fresh installs of the latest snapshot of osc2.2. When I register as a new user I get the following error message come up while logged in right above the shopping cart.

 

1064 - You have an error in your SQL syntax near 'MAX_DISPLAY_PRODUCTS_IN_ORDER_HISTORY_BOX' at line 1

 

select distinct op.products_id from orders o, orders_products op, products p where o.customers_id = '1' and o.orders_id = op.orders_id and op.products_id = p.products_id and p.products_status = '1' group by products_id order by o.date_purchased desc limit MAX_DISPLAY_PRODUCTS_IN_ORDER_HISTORY_BOX

 

I have checked but can't find any references to this. I looked around the forums but haven't found anything on this. ANY help or hints towards what to look for would be very much appreciated!

 

Thank you!!

Link to comment
Share on other sites

I have been working on this for several hours now.. I know that this problem has something to do with the following code located in the order_history.php

 

 if (tep_session_is_registered('customer_id')) {

// retreive the last x products purchased

   $orders_query = tep_db_query("select distinct op.products_id from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_PRODUCTS . " p where o.customers_id = '" . $customer_id . "' and o.orders_id = op.orders_id and op.products_id = p.products_id and p.products_status = '1' group by products_id order by o.date_purchased desc limit " . MAX_DISPLAY_PRODUCTS_IN_ORDER_HISTORY_BOX);

   if (tep_db_num_rows($orders_query)) {

 

I have tried downloading the MS1 release.. I have tried reloading the order tables for the database.. I have tried to figure out what is wrong with this snip of code.. but no matter what I try I cannot get pass this!

 

What is worse is that orders don't seem to be getting processed either.. they are not appearing in the admin!

 

I don't understand why nobody else is having the same problem with the order history. Could someone please point me in some direction here.. I have run out of options here.

 

Thank you!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...