Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

1064-...near '{3}29 at line 1


Guest

Recommended Posts

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 '{3}29' at line 1

 

select * from products as p, products_description as pd where p.products_id = pd.products_id and pd.products_id = 73{3}29

 

[TEP STOP]

 

The above is my error, and it only occurs when clicking in the "shopping cart" box on an item which has attributes attached to it. Items which do not have product attributes do not error when clicked on them.

Running: MS2, PHP 4.3.2, Zend 1.3.0

 

Can't figure this one out, doesn't help that I don't know enough about MySQL.

Any help would be much appreciated.

My Webpage

Link to comment
Share on other sites

Hi,

 

Thats not a good bug to have, it came form infobox skin manager.

 

catalog/includes/skin_top.php

 

Change this

 

$prod_name_query = tep_db_query("select * from " . TABLE_PRODUCTS . " as p, " . TABLE_PRODUCTS_DESCRIPTION . " as pd where p.products_id = pd.products_id and pd.products_id = " . $HTTP_GET_VARS['products_id']);

 

To this

 

$prod_name_query = tep_db_query("select products_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");

 

There was several problems with that SQL query but the problem causing your error was the missing (int) before $HTTP_GET_VARS['products_id']

Link to comment
Share on other sites

YES! That is the fix. Thank you very much for your response and the code to replace the bug with.

Dave, If ya ever need t-nuts..... :)

 

--Jeff

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...