Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

manufacturers from id 10 to 30 how pls


Salvo

Recommended Posts

Posted

HI all

 

I have the below code that retrieve the manufacturers and show them

by name order..

 

Question:

How do you search manufacturers from id 20 to id 40 ?

 

thanks

 

$query = tep_db_query("select distinct m.manufacturers_id, m.manufacturers_name from " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS . " p where m.manufacturers_id=p.manufacturers_id order by manufacturers_name");

Posted

The following should do it:

$query = tep_db_query("select distinct m.manufacturers_id, m.manufacturers_name from " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS . " p where m.manufacturers_id=p.manufacturers_id and m.manufacturers_id => '20' and m.manufacturers_id <= '40' order by manufacturers_name");

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Posted

HI just tried the above and gives me this error

 

1064 - You have an error in your SQL syntax near '=> '20' and m.manufacturers_id <= '40' order by manufacturers_name' at line 1

 

any reason why?

Archived

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

×
×
  • Create New...