PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
You'd be better of rethinking your database design. You want a many-to-many relationship. Something like this:
users table - id, name
fruits table - id, name
users/fruits - id, id
There probably is a way to explode values in a column in SQL and then to JOIN them to the names in the fruits table, but it's just making things more complicated.
jayshields wrote:You'd be better of rethinking your database design. You want a many-to-many relationship. Something like this:
users table - id, name
fruits table - id, name
users/fruits - id, id
There probably is a way to explode values in a column in SQL and then to JOIN them to the names in the fruits table, but it's just making things more complicated.
It's more than that, it's just plain wrong. If you need a many-to-many relationship, the only valid way to do it is with a third table, as jayshields showed.