Answer the question
In order to leave comments, you need to log in
Displays id of all products by category id?
Hi all!
I am trying to make a sql query but the result is zero
code
public function getProductCategory($category_id) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_to_category WHERE product_id = '" . (int)$category_id . "'");
return $query->rows;
}
Answer the question
In order to leave comments, you need to log in
select all products by category_id
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_to_category WHERE category_id = '" . (int)$category_id . "'");
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question