Guest Posted March 13, 2006 Posted March 13, 2006 I have sold my first product yesterday. The order went though although there was an error message: - 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 'limit 0, 12' at line 1 select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from orders o left join orders_total ot on (o.orders_id = ot.orders_id), orders_status s where o.orders_status = s.orders_status_id and s.language_id = '1' and s.orders_status_id = '2' and ot.class = 'ot_total' order by limit 0, 12 can anyone see anything which is obviouisly wrong about this statement and if so where can i find the file in which to correct it? Any help would be most appreciated! thanks!
schmartz Posted March 13, 2006 Posted March 13, 2006 I've just found we're having the same problem on an installation that used to work. It's not happening on all accounts. I can see no pattern to the accounts it's occuring on, some old, some new. This install has been in place for 2 years with no problems before. 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 '-20, 20' at line 1 select o.orders_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from orders o left join orders_total ot on (o.orders_id = ot.orders_id), orders_status s where o.customers_id = '92' and o.orders_status = s.orders_status_id and s.language_id = '1' and ot.class = 'ot_total' order by orders_id DESC limit -20, 20
nsoft Posted March 13, 2006 Posted March 13, 2006 I have sold my first product yesterday. The order went though although there was an error message: - 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 'limit 0, 12' at line 1 select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from orders o left join orders_total ot on (o.orders_id = ot.orders_id), orders_status s where o.orders_status = s.orders_status_id and s.language_id = '1' and s.orders_status_id = '2' and ot.class = 'ot_total' order by limit 0, 12 can anyone see anything which is obviouisly wrong about this statement and if so where can i find the file in which to correct it? Any help would be most appreciated! thanks! Obviously ORDER BY must be followed by field name: ... ORDER BY customers_name ...
schmartz Posted March 13, 2006 Posted March 13, 2006 Obviously ORDER BY must be followed by field name: ... ORDER BY customers_name ... Do you mean at the end "order by orders_id DESC limit -20, 20"? That's selecting an order. I see on Aidan's that it's missing but on ours there is a field name - order_id.
Guest Posted March 13, 2006 Posted March 13, 2006 Ok! do you know where i can find this statement to edit it? so if i changed the statement to something like "order by customers_name DESC limit 0, 12" you think this might work? Also while im on this subject, If i changed the DESC to ASC on this statement would that reverse the order of my product listing? Im sorry if this seems an obvious question but i am very new to sql etc. If you could tell me where to find it that would be great anyway! Thank for the reply!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.