Results 1 to 3 of 3
  1. #1

    Default 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. #2
    Join Date
    Jan 2007
    Location
    Amersham
    Posts
    511

    Default

    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

  3. #3

    Default 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!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •