Jump to content

Archived

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

sagitario

1064 - You have an error in your SQL syntax;

Recommended Posts

Hey

 

I have a problem with my catalog. When a client try to see his account history he they receive the follow 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 '-0, 0' 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 = '4' and o.orders_id = ot.orders_id and ot.class = 'ot_total' and o.orders_status = s.orders_status_id and s.language_id = '2' order by orders_id DESC limit -0, 0

[TEP STOP]

 

I try to edit /includes/classes/split_page_results.php and change:

 

$offset = ($max_rows_per_page * ($current_page_number - 1));

$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;

 

To this:

 

$offset = ($max_rows_per_page * ($current_page_number - 1));

if ($offset < 0) { $offset = 0 ; }

$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;

 

The error problem is resolve but it cause other like de link page became some like this -> -4, -3, -2, -1, 0

And the in new produtos in first page became bad organized.

 

Someone can help me?

 

Thanks

Share this post


Link to post
Share on other sites

Go to the link at the top of the forum homepage which will take you to the update files for osCommerce 2.2 MS2 (the current version). The fix for your problem is provided in that download.

 

Vger

Share this post


Link to post
Share on other sites

I have already made that update, but because i have made some change in my catalog design, i only update the following files:

 

catalog/admin/includes/classes/email.php

catalog/admin/includes/classes/split_page_results.php

catalog/admin/includes/classes/upload.php

catalog/admin/includes/functions/database.php

catalog/admin/includes/functions/general.php

catalog/admin/includes/functions/html_output.php

catalog/admin/categories.php

catalog/admin/file_manager.php

catalog/admin/orders.php

 

catalog/includes/classes/email.php

catalog/includes/classes/shopping_cart.php

catalog/includes/classes/split_page_results.php

catalog/includes/functions/database.php

catalog/includes/functions/general.php

catalog/includes/functions/html_output.php

catalog/includes/functions/sessions.php

catalog/address_book_process.php (051113)

catalog/advanced_search_result.php

catalog/index.php

catalog/redirect.php

 

And the error continues...

Share this post


Link to post
Share on other sites

×