Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

SQL SYNTAX error in link to NEW PRODUCTS


jakobus

Recommended Posts

Posted

Trying the left side "NEW PRODUCTS", I've got this:

 

1064 - You have an error in your SQL syntax near 'select p.products_id, pd.products_name, p.products_image, p.products_price, p.pr' at line 1

 

select count(select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name from products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id left join products_description pd on p.products_id = pd.products_id and pd.language_id = '2' left join specials s on p.products_id = s.products_id where p.products_status = '1' order by p.products_date_added DESC, pd.products_name) as total

 

[TEP STOP]

 

 

??? can anybody help on this problem ?

Posted

What does the code lines 1060-1070 look like in your .php file?

 

What version of osCommerce are you using?

 

Thanks,

Matt

Posted

Hi Matt, these should be the lines you requested, I'm using 2.2 MS1

 

<?php

$products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' order by p.products_date_added DESC, pd.products_name";

 

$products_new_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_PRODUCTS_NEW, $products_new_query_raw, $products_new_numrows);

 

products_new_query = tep_db_query($products_new_query_raw);

while ($products_new = tep_db_fetch_array($products_new_query)) {

$products_new_array[] = array('id' => $products_new['products_id'],

'name' => $products_new['products_name'],

'image' => $products_new['products_image'],

'price' => $products_new['products_price'],

'specials_price' => $products_new['specials_new_products_price'],

'tax_class_id' => $products_new['products_tax_class_id'],

'date_added' => tep_date_long($products_new['products_date_added']),

'manufacturer' => $products_new['manufacturers_name']);

}

 

thanks for looking at it

jakobus

Archived

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

×
×
  • Create New...