Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

help with a sql query...


bobsi18

Recommended Posts

hi there all... i'm trying to add a second manufacturer to my site and am currently working on the advanced search page... I want people to be able to choose a manufacturer and a 2nd manufacturer from the drop down menus (like what's already there, but with the extra one as well)... I've narrowed it down to this code on the advanced search page (about line 213):

$from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id";

 

I'm trying to add my second manufacturer in here (I've adready added it to the queries above).. where manufacturer2 is the second manufacturer. This is what I've got so far...

$from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), left join " . TABLE_MANUFACTURERS2 . " m2 using(manufacturers2_id) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id";

I'm having trouble with the using(manufacturers2_id) part, does anyone know how to join this altogether properly???

 

Thanks for any insight!

~bobsi18~

Link to comment
Share on other sites

hi there all... i'm trying to add a second manufacturer to my site and am currently working on the advanced search page... I want people to be able to choose a manufacturer and a 2nd manufacturer from the drop down menus (like what's already there, but with the extra one as well)... I've narrowed it down to this code on the advanced search page (about line 213):

$from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id";

 

I'm trying to add my second manufacturer in here (I've adready added it to the queries above).. where manufacturer2 is the second manufacturer. This is what I've got so far...

$from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), left join " . TABLE_MANUFACTURERS2 . " m2 using(manufacturers2_id) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id";

I'm having trouble with the using(manufacturers2_id) part, does anyone know how to join this altogether properly???

 

Thanks for any insight!

~bobsi18~

 

Got it! For anyone else looking -->

$from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on m.manufacturers_id=p.manufacturers_id left join " . TABLE_MANUFACTURERS2 . " m2 on m2.manufacturers2_id=p.manufacturers2_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id";

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...