Guest Posted December 3, 2004 Share Posted December 3, 2004 >_< For some reason when I log into my admin area and attempt to check customer's orders I get this error. 1064 - You have an error in your SQL syntax near 'limit 0, 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 = '8' and o.orders_status = s.orders_status_id and s.language_id = '1' and ot.class = 'ot_total' order by limit 0, 20 [TEP STOP] Will someone please tell me how I might fix this? Immediatly following that error I get a box that goes from left to right across the legnth of the page with a lot of broken images. It's killing me that I can't get this to work when it was working just fine yesterday. GRRRRR :'( Thank you in advance Link to comment Share on other sites More sharing options...
user99999999 Posted December 3, 2004 Share Posted December 3, 2004 Its missing the order by field order by __________ limit 0, 20 Did you add some contrib maybe sortable orders It should be like this for MS2 order by o.orders_id DESC Link to comment Share on other sites More sharing options...
KieranMullen Posted December 8, 2004 Share Posted December 8, 2004 I get this error too.. Fresh install no contribs...LAtest version I think it has to do with the version of mysql althought the setup went fine... I dropped all tables from BD and added sql from install file. Error still remains. However it will show when there is Zero Example after fresh install go to customers and it lists john doe... no error.. after you delete john doe then there is error.. Customers Search: 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 c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, a.entry_country_id from customers c left join address_book a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id order by c.customers_lastname, c.customers_firstname limit -20, 20 My sql version is... mysql Ver 14.7 Distrib 4.1.7, for pc-linux (i686) Thanks! Link to comment Share on other sites More sharing options...
Guest Posted December 8, 2004 Share Posted December 8, 2004 Actually I just reinstalled it and that fixed it. But no I hadn't added any mods like that at all. Still having other issues with OSC that I posted about but as of yet have heard nothing back on. But thank you for your response. Link to comment Share on other sites More sharing options...
KieranMullen Posted December 8, 2004 Share Posted December 8, 2004 What version of mysql, oscommerce and php you running ? Thanks KM Link to comment Share on other sites More sharing options...
Beatbomber Posted December 31, 2004 Share Posted December 31, 2004 I only know the reason for this problem. MySQL with version higher than 4.X doesn?accept null or negative values. But I am not familiar with SQL therfore I can?t solve the problem What version of mysql, oscommerce and php you running ? Thanks KM <{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
jallajalla Posted May 13, 2005 Share Posted May 13, 2005 I only know the reason for this problem. MySQL with version higher than 4.X doesn?accept null or negative values. But I am not familiar with SQL therfore I can?t solve the problem <{POST_SNAPBACK}> Have anyone solve this problem? I get this error on all pages with empty tables. Link to comment Share on other sites More sharing options...
Guest Posted May 13, 2005 Share Posted May 13, 2005 related to mysql 4.1, search tips and tricks for 1064 Link to comment Share on other sites More sharing options...
jallajalla Posted May 13, 2005 Share Posted May 13, 2005 related to mysql 4.1, search tips and tricks for 1064 <{POST_SNAPBACK}> Thanks a lot! Anyone else need this? Here is the fix I found, and it works!! :-) -------------------------------------------------- In admin/includes/classes find split_page_results.php and - BACK IT UP then find the lines $offset = ($max_rows_per_page * ($current_page_number - 1)); $sql_query .= " limit " . $offset . ", " . $max_rows_per_page; change to $offset = ($max_rows_per_page * ($current_page_number - 1)); if ($offset < 0) { $offset = 0 ; } $sql_query .= " limit " . $offset . ", " . $max_rows_per_page; ------------------------------------------------ Link to comment Share on other sites More sharing options...
EdTheGreat Posted October 5, 2005 Share Posted October 5, 2005 Thanks a lot! Anyone else need this? Here is the fix I found, and it works!! :-) -------------------------------------------------- In admin/includes/classes find split_page_results.php and - BACK IT UP then find the lines $offset = ($max_rows_per_page * ($current_page_number - 1)); $sql_query .= " limit " . $offset . ", " . $max_rows_per_page; change to $offset = ($max_rows_per_page * ($current_page_number - 1)); if ($offset < 0) { $offset = 0 ; } $sql_query .= " limit " . $offset . ", " . $max_rows_per_page; ------------------------------------------------ Thanks for the contribution! It Worked..... Ed Link to comment Share on other sites More sharing options...
Guest Posted October 10, 2005 Share Posted October 10, 2005 Thanks for the contribution! It Worked..... Ed Thanks a bunch! This fixed the problems I was having as well. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.