Boards of Canada
Member
Hopefully this makes sense.
Let's say I have a table called Fruits with 3 fruits:
At some point in HTML, I will convert that table into a selectable list that allows for multiple selections. So you could select Apple, or Apple + Grape.
When you submit this form, it inserts the data in a table. But I want it so that the IDs of the fruit are kept in one cell. So a table might look like this:
Then I want to be able to take that "1, 2, 3" data in PHP, separate it, and display something like if ($table_row->fruit == 1) { echo "Apple." }.
I have no idea how to do this, or if there's a better way of creating the tables to begin with.
Let's say I have a table called Fruits with 3 fruits:
Code:
table Fruits
==============
1 Apple
2 Orange
3 Grape
When you submit this form, it inserts the data in a table. But I want it so that the IDs of the fruit are kept in one cell. So a table might look like this:
Code:
id yourname fruit
=============================
1 Me 1, 3
2 You 1, 2, 3
3 Him 2
I have no idea how to do this, or if there's a better way of creating the tables to begin with.