Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

syntax error 1064


WendyM

Recommended Posts

Went to product page to see how it was coming along and got this 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 '' at line 1

 

select p.products_id, p.products_image from orders_products opa, orders_products opb, orders o, products p where opa.products_id = '11' and opa.orders_id = opb.orders_id and opb.products_id != '11' and opb.products_id = p.products_id and opb.orders_id = o.orders_id and p.products_status = '1' group by p.products_id order by o.date_purchased desc limit

 

[TEP STOP]

 

Here is the first few lines of the product_info.php page.

Can anyone see where the error may be?

I haven't changed anything in that file.

So don't understand how it has an error now. :?:

 

<?php

/*

$Id: product_info.php,v 1.97 2003/07/01 14:34:54 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);

 

$product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

$product_check = tep_db_fetch_array($product_check_query);

?>

 

Thanks for the help!

Wendy

Link to comment
Share on other sites

The error appears on ALL product pages.

 

I don't get errors anywhere else, so it seems the error just affects those pages.

 

Thanks for any help, I'm still learning.

 

Wendy

Link to comment
Share on other sites

Having one table referred to as both 'orders_products opa' and 'orders_products opb' is ambiguous - what exactly are you trying to do?

Link to comment
Share on other sites

I've been adding products via the catalog admin.

 

I've used MyPhp to remove some of the osCommerce pre-input data.

 

I've got no idea how I got the a and b thing. :shock:

 

So how would I remove one of them, or do I need to remove both of 'em?

 

AND...how do I make sure I don't do this again?

 

Much appreciation for your time/help!

 

:-)

Link to comment
Share on other sites

The query is to the products, orders_products and orders tables for also purchased products - its ok, but the data may not be - have you manually changed anything in these tables with PhpMyAdmin?

Link to comment
Share on other sites

that is quite possible...

 

I will not be using the 'also purchased' element and could've easily messed up while trying to "drop" or "empty" that table.

 

Oscommerce is my first attempt at database and I'm still a bit perplexed in some areas, esp where php and mysql used together are concerned.

 

Is there an easy way to fix this mess?

 

I don't want that error to keep showing up.

Link to comment
Share on other sites

You could just make catalog/includes/module/also_purchased_products an empty file - this would save editing all the calls to it in other files - this should also clear up your error

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...