mrconfused786 Posted April 29, 2010 Share Posted April 29, 2010 Hello, I went to the admin panel to view my orders and I see this big sql 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 '-20, 20' 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 ot.class = 'ot_total' order by o.orders_id DESC limit -20, 20 Why is it doing that? Thanks. Link to comment Share on other sites More sharing options...
Guest Posted April 29, 2010 Share Posted April 29, 2010 Hello, I went to the admin panel to view my orders and I see this big sql 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 '-20, 20' 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 ot.class = 'ot_total' order by o.orders_id DESC limit -20, 20 Why is it doing that? Thanks. What line is this in cataloge/admin/orders.php? p.s. did u made any changes in this file? Link to comment Share on other sites More sharing options...
♥mdtaylorlrim Posted April 29, 2010 Share Posted April 29, 2010 Hello, I went to the admin panel to view my orders and I see this big sql 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 '-20, 20' 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 ot.class = 'ot_total' order by o.orders_id DESC limit -20, 20 Why is it doing that? Thanks. That line is not in either of the stock osC order.php files, so where exactly do you get this error? When you are on the main Administration page or on the Customers -> Orders page? Or another? Community Bootstrap Edition, Edge Avoid the most asked question. See How to Secure My Site and How do I...? Link to comment Share on other sites More sharing options...
MrPhil Posted April 30, 2010 Share Posted April 30, 2010 The "negative number in a LIMIT" problem was fixed quite a while ago. It involves changing the value " limit " . $offset to " limit " . max($offset, 0) in the LIMIT clause. In stock osC, there's one each in both "split_page_results.php" files. If you have any add-ons, there may be more. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.