Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Need help forming an sql statement


Guyver

Recommended Posts

Posted

Hello,

 

I'm trying to change around the product_info.php so when you display a product it will display the manufacturers name infront of the product_description.

 

I've no problem with the 'display' part, the main thing I can't suss is the SQL call to pick out the fields I need. Not really having a clue what I'm doing doesnt help!!..

 

This is what I've got so far :)

 

$product_info = tep_db_query("select p.products_id, p.manufacturers_id, pd.products_name, p.products_model, pd.products_description , m.manufacturers_name  from " . TABLE_PRODUCTS . " p, " . TABLE_PRO

DUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and pd.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . $HTTP_GET_VARS['manufacturers_id'] . "' and pd.language_id = '" . $languages_id . "'");

 

 

The idea behind above was to pick out the manufacturers_id from the product table and then link up with the manufacturers table, I know I'm close (I hope), but close aint really good enough :oops:

 

If any SQL buffs could nudge me in the right direction I'd be very happy :P

 

Thanks for you time

 

John

Archived

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

×
×
  • Create New...