Hello I want to create a form that accepts multiple input at a single time. I'm not worried about the mySQL commands those are simple and easy to fix.
What I am focusing on is the actual form and the php code that will be used to send the data into the database.
Do I need to create an array that will hold the different variables, is there any way I can create a foreach loop that will then reduce the lines of code... Do the number of lines of code matter????
I am new to php I only learned html and css, and I have learned a little from java , python, and now php..... I am focused on mastering PHP I just need a little guidance.
What I have tried:
Well I have tried coding this by repeating the same line of code with a different name here is a snippet so you know what I mean..
<input type="text"name="name10" />
<input type="text" name="amount10" />
A <input type="radio" name="type10"/>
b <input type="radio" name="type10"/>
c <input type="radio" name="type10"/>
The code is repeated over and over again
$name10 = $_POST['name10'] $type10 = $_POST['type10'] $amount10 = $_POST['amount10'];
$sql="INSERT INTO table 1(name, type, amount)
VALUES('$name10', '$type10' ,'$amount10');";
Same deal with the php code and the sql to insert every value input into the form... Am I doing this right???