Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Error in account_history "1064 - You have an error in your SQL syntax;"


CatDadRick

Recommended Posts

Just when I thought I had all of the PHP5/MySQL5 problems solved I get this...

 

I logged in as my test customer and went to Account > View the Orders I Have Made. Instead of a list of orders I get

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

select o.orders_id, o.date_purchased, o.delivery_name, o.billing_name, ot.text as order_total, s.orders_status_name from orders o, orders_total ot, orders_status s where o.customers_id = '1' and o.orders_id = ot.orders_id and ot.class = 'ot_total' and o.orders_status = s.orders_status_id and s.language_id = '1' and o.orders_status != '99999' order by orders_id DESC limit -10, 10

[TEP STOP]

Here's the query in catalog/account_history.php

$history_query_raw = "select o.orders_id, o.date_purchased, o.delivery_name, o.billing_name, ot.text as order_total, s.orders_status_name from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = ot.orders_id and ot.class = 'ot_total' and o.orders_status = s.orders_status_id and s.language_id =  '" . (int)$languages_id . "' and o.orders_status != '99999' order by orders_id DESC";

Is this another compatibility issue with PHP5/MySQL5? Can someone point towards a solution?

 

Thanks,

Rick

Link to comment
Share on other sites

Try googling for

 

www.oscommerce.com/forums: "limit -"

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...