Salvo Posted December 8, 2005 Posted December 8, 2005 Hi all I have a function which list all manufactueres. Now I like to have only manufactuerers in a category ie. category id 2. The category id is here $current_category_id it gives an ID = 2 , but inside the function below it returns nothing.. why? Thanks for help function manufacturers_list(){ global $manufacturer; $manufacturers_query = tep_db_query("select distinct m.manufacturers_id, m.manufacturers_name from " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_SPECIALS . " s where m.manufacturers_id = p.manufacturers_id and p.products_id = s.products_id and p.products_id = p2c.products_id and p2c.categories_id = '" . $current_category_id . "' order by manufacturers_name"); etc etc...
♥Monika in Germany Posted December 8, 2005 Posted December 8, 2005 Hi all I have a function which list all manufactueres. Now I like to have only manufactuerers in a category ie. category id 2. The category id is here $current_category_id it gives an ID = 2 , but inside the function below it returns nothing.. why? Thanks for help function manufacturers_list(){ global $manufacturer; $manufacturers_query = tep_db_query("select distinct m.manufacturers_id, m.manufacturers_name from " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_SPECIALS . " s where m.manufacturers_id = p.manufacturers_id and p.products_id = s.products_id and p.products_id = p2c.products_id and p2c.categories_id = '" . $current_category_id . "' order by manufacturers_name"); etc etc... $current_category_id is a global, but you have not declared it ... try this: function manufacturers_list(){ global $manufacturerm, $current_category_id; etc etc :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...
Salvo Posted December 8, 2005 Author Posted December 8, 2005 Thank you very much Monika..... Very nice. I have learnt something more today... Thanks
Recommended Posts
Archived
This topic is now archived and is closed to further replies.