I have a column in table “recipes” called “Products”. This is is filled like this:
460,450|50,100|243,500|141,5|457,100|383,211|
ProductID,ProductGrams| is the format.
Now i would like to search for an product with id 243 in the above example. How can i do this?
SELECT * FROM recipes WHERE Products LIKE '%243%'
Will also give me results if theres productgrams that are 243.
How can i do this? Im lost…
Its ok if theres also php for a solution to this.
You could do
But more importantly this data should be normalized in the database prior to being queried.