How to join a tableA.id on a serialized tableB field???

Discussion in 'MySQL' started by 123GoToAndPlay, Feb 17, 2010.

  1. #1
    Hi,

    Storing multiple colors with checkboxes and store the colors as serialize data and unserialize to repopulate the form checkboxes.

    For this, i have a tableA with colorID and colorName

    In tableB i store a serialized array with multiple colorID's in field colors.

    How do return the colorName with on query??
    
    Select tableA.colorID as colorID, tableA.colorName as colorName FROM tableA JOIN ....
    
    Code (markup):
    Hope you understand my question
     
    123GoToAndPlay, Feb 17, 2010 IP
  2. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #2
    did you use php to serialize data from table b?
     
    bartolay13, Feb 17, 2010 IP
  3. 123GoToAndPlay

    123GoToAndPlay Peon

    Messages:
    669
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    yes, i used php serialized function
     
    123GoToAndPlay, Feb 20, 2010 IP
  4. pulsorock

    pulsorock Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I would like to know this too...

    I'm developing something similar and I'm using serialized arrays to be stored on mysql and wonder how to accomplish that.

    Thanks!
     
    pulsorock, Mar 3, 2010 IP
  5. jimmy4feb

    jimmy4feb Peon

    Messages:
    56
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Please show some data in your tables giving an example like this

    
    
    Table A
    colorID     colorName
    1                 Red
    2                 Green
    3                 Blue
    4                 Yellow
    
    Table B
    The fields you are using....
    
    
    Code (markup):
    So you will write all the column names you are using on these two tables.....

    I will try to help you.

    Thanks,

    Jimmy
     
    jimmy4feb, Mar 3, 2010 IP