Announcement

Collapse
No announcement yet.

mysql field type SET to PHP

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • mysql field type SET to PHP

    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

  • #2
    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

    Comment


    • #3
      Checkbox Form pulling from SET column values

      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!

      Comment

      Working...
      X