Code: Select all
--field 'product_categories'--
record 1: 12,14,1,4
record 2: 19
record 3: 15,1,2Now the problem comes when I am on the 'product category' page and am looking to display the products. At first you could only give a product 1 product category so all I would do would be to run a simple query like this:
Code: Select all
SELECT
*
FROM
products
WHERE
fk_product_category_id = "4"Code: Select all
SELECT
*
FROM
`kb_products`
WHERE
`active` = "1"
AND
"19" IN (product_categories)So, how do I write a query that will get the correct results for me regardless of where the number is in the list