Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

1109 - Unknown table 'pd' in field list


betty

Recommended Posts

Posted

Hi Everyone,

 

I did the contribution which adds a short product description field (product_info) to the product description table, and would now like to have this product_info included in my featured products module.

 

I've included pd.products_info in the following code at the top of the page:

 

$featured_products_query = tep_db_query("select p.products_id, p.products_image, pd.products_info, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price, p.products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_status = '1' and f.status = '1' order by p.products_date_added desc limit " . 6);
} else {
  $info_box_contents[] = array('align' => '', 'text' => '');
  $featured_products_query = tep_db_query("select distinct p.products_id, p.products_image, pd.products_info, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price, p.products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . $featured_products_category_id . "' and p.products_status = '1' and f.status = '1' p.products_date_added desc limit " . 6);
}

 

and I've also put $featured_products['products_info'] where I'd like the info to appear on the page, but I'm getting the following error message:

 

1109 - Unknown table 'pd' in field list

 

select p.products_id, p.products_image, pd.products_info, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price, p.products_price from products p left join specials s on p.products_id = s.products_id left join featured f on p.products_id = f.products_id where p.products_status = '1' and f.status = '1' order by p.products_date_added desc limit 6

 

[TEP STOP]

 

Do I need to mention the product description table somewhere maybe?? I'd be very grateful for any guidance as am completely stuck!!

 

Thanks!

 

Betty

Posted

Yes - you can add it into the query like this:

 

TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join "

 

Matti

Archived

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

×
×
  • Create New...