View Single Post
  #24  
Old 06-23-2005, 09:15 PM
 
Joe Schwartz Joe Schwartz is offline
 

Newbie
  
Join Date: Mar 2005
Location: New York City
Posts: 7
 

Default SQL error in version 4.0.12

I've tried to adapt this code for my 4.0.12 x-cart store, but keep getting this error:

Quote:
SELECT * from WHERE productid='13' Error code : 1064 Description : You have an error in your SQL syntax near 'WHERE productid='13'' at line 1

The error occurs with any product (any productid) regardless of whether or not it has product options. I'm pretty sure the error is in the products.php file in this section:

Code:
// first we build a query to get all the product options with a single query $query="SELECT * from $sql_tbl[product_options] WHERE "; foreach($products as $key=>$value){ $query.="productid='$value[productid]' "; if($i < $productcount-1){ $query.="OR "; } $i++; }

I know this is an old thread, but if anyone has adapted this code for 4.x.x of x-cart, I'd be grateful for any insight.

Many thanks,

Joe
__________________
Version 4.0.14
Unix server
www.happyhappyhappy.com (live)
Reply With Quote