Jump to content

gamergomer

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

gamergomer's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. 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.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.