I'm simplifying this a lot:
First, I have a html form that asks for an answer 5 times to fill a column of data for my database. Really there are more than one question, but I'm going to simplify it here:
Color: <input type="text" size="15" maxlength="10" name="1color"></br>
Color: <input type="text" size="15" maxlength="10" name="2color"></br>
Color: <input type="text" size="15" maxlength="10" name="3color"></br>
Color: <input type="text" size="15" maxlength="10" name="4color"></br>
Color: <input type="text" size="15" maxlength="10" name="5color"></br>
Then my php file will have this at the beginning:
$1color=$_POST['1color'];
$2color=$_POST['2color'];
$3color=$_POST['3color'];
$4color=$_POST['4color'];
$5color=$_POST['5color'];
Then a little later, I'd have something like this:
INSERT INTO `mytable` ('id','colors')
VALUES (NULL, $1color),
VALUES (NULL, $2color),
VALUES (NULL, $3color),
VALUES (NULL, $4color),
VALUES (NULL, $5color);
Now that's all fine and dandy for a single item, but when you have 10 items and a longer table, it makes it more complicated and harder to change things later. So I want to change the individual color1, color2, etc into an array and then have it put the arrays into the table. Can I put stuff into an array from the form? Or how do I do it at the begging of the php file? And then how do handle the data input?
If anyone can help or point me in the right direction, I'd appreciate it.