if i have a mysql table with a column with type SET and values x, y,z and a want a listing from all rows where this column has the values x and z, how do i do this in php
thanks in advance
if i have a mysql table with a column with type SET and values x, y,z and a want a listing from all rows where this column has the values x and z, how do i do this in php
thanks in advance
SELECT * FROM tbl_name WHERE FIND_IN_SET('x',set_col_name)>0 and FIND_IN_SET('z',set_col_name)>0
David Allen - www.serina.co.uk
Hello,
Thanks for your answer, I'm new to all this and the online community has been great.
In the example above, what if I have more values in the SET column, and want to get matches from a form?
I have Breakfast Baskets, and a SET type column with FruitsinBasket ('orange','grapes','apples','straberries',....)
I have a page where customers can choose their selection of fruits (checkboxes) and by submitting it would return a list of the BreakfastBaskets that match the selection of fruits.
Thanks in advance!
There are currently 1 users browsing this thread. (0 members and 1 guests)