Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Strange database errors


Emils

Recommended Posts

I'm helping a friend with his osC powered shop and I have som php/sql knowledge but when I moved the shop to another server it gives me strange errors which I'm not able to debug.

 

This error occures when I'm looking at my own order history (If I have no order history, no 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 '-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 = '1352' and o.orders_id = ot.orders_id and ot.class = 'ot_total' and o.orders_status = s.orders_status_id and s.language_id = '4' order by orders_id DESC limit -10, 10

 

[TEP STOP]

 

Almost the same error occures when trying to look at "pending" orders from admin page.

 

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 = '4' and s.orders_status_id = '1' and ot.class = 'ot_total' order by o.orders_id DESC limit -20, 20

 

What I don't understand is why "pending" doens't work when "delivered" and "processed" works. Has anybody a clue what's wrong?

 

Thanks,

Emil

Link to comment
Share on other sites

Download the security update contribution and make the changes for the split_page_results.php files (you should really install all of the changes though).

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Download the security update contribution and make the changes for the split_page_results.php files (you should really install all of the changes though).

 

Jack

 

I have done though, but with no luck, the problem persists, do you have any other clues?

Link to comment
Share on other sites

 

I have done this without luck. It didn't work out. I always get the following error when trying to access the products in admin:

 

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 'from products p, products_description pd where p.products_id = pd.products_id an' at line 1

select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_url, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, from products p, products_description pd where p.products_id = pd.products_id and p.products_id = '18'

 

I believe it maybe because the products have been deleted all once from the products table. When I checked it I have found that it starts with Id 8! But I don't know what to do about it.

Link to comment
Share on other sites

I have done this without luck. It didn't work out. I always get the following error when trying to access the products in admin:

 

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 'from products p, products_description pd where p.products_id = pd.products_id an' at line 1

select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_url, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, from products p, products_description pd where p.products_id = pd.products_id and p.products_id = '18'

 

I believe it maybe because the products have been deleted all once from the products table. When I checked it I have found that it starts with Id 8! But I don't know what to do about it.

I was not refering to your problem but to the original poster. In your case you have to remove that coma before the "from" in your query, wherever that happens as you havent said the script that has the problem.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...