Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Error message specials.php


Lufine

Recommended Posts

Hi,

 

got problems with my specials.php:

 

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 'products_description pd, specials s where p.products_status = '

select count(*) as total from products p, manufacturers m where m.manufacturers_id = p.manufacturers_id products_description pd, specials s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '2' and s.status = '1'

 

 

This is the relating part of the specials.php:

 

<?php

$specials_query_raw = "select p.products_id, pd.products_name, m.manufacturers_name, p.manufacturers_id, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_MANUFACTURERS . " m where m.manufacturers_id = p.manufacturers_id " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added DESC";
$specials_split = new splitPageResults($specials_query_raw, MAX_DISPLAY_SPECIAL_PRODUCTS);
if (($specials_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>

 

Has anyone an idea?

 

Thanks

Lufine

Link to comment
Share on other sites

change this:

 

$specials_query_raw = "select p.products_id, pd.products_name, m.manufacturers_name, p.manufacturers_id, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_MANUFACTURERS . " m where m.manufacturers_id = p.manufacturers_id " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added DESC";

 

to:

 

$specials_query_raw = "select p.products_id, pd.products_name, m.manufacturers_name, p.manufacturers_id, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_MANUFACTURERS . " m,  TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where m.manufacturers_id = p.manufacturers_id and p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added DESC";

Link to comment
Share on other sites

Thanks so far, but this is what I get now:

 

Parse error: parse error, unexpected T_STRING in /homepages/1/d26448734/htdocs/catalog/specials.php on line 78

 

 

i had the same problem. not sure how you SQL skills are but if you go into the sql database and actually make an entry into the specials table. it will work fine. annoying yes but it'll work.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...