Bonjour,
Mon problème est simple, je voudrais récupérer le nom de la catégorie pour le mettre dans le titre de la page lorsque je fais une recherche par fabricant. (intéressant dans mon cas car fabricant sont des personnes)
Mais voila les left join et moi, ça fait 2.
Ce que j'ai, si recherche par catégorie, affiche catégorie.
$the_category_query = tep_db_query("select cd.categories_name from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
$the_category = tep_db_fetch_array($the_category_query);
Ce que je voudrai, si recherche par manufacturer include categorie_name
Or je ne peux récupérer la catégorie_name que via products_to_categories et c'est la que je suis perdu
$the_category_query = tep_db_query("select cd.categories_name, c_categories_id, p2c.products_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd left join ". TABLE_PRODUCTS_TO_CATEGORIES . "p2c where p2c.products_id = '" . (int)$current_products_id . "' and and cd.language_id = '" . (int)$languages_id . "'");
Est-ce que ça peut marcher?