i want to do insert as many rows as the number in $add_rows = $_POST['add-rows'] to a table. for what i'm working now, i need 32 rows. how do i go about making the SQL VALUES part a loop so it enters 32 rows??
this is my form
<form>
<input name="add-name" id="add-name" type="text" value="">
<input name="add-start" id="add-start" type="text" value="">
<input name="add-end" id="add-end" type="text" value="">
<input name="add-rows" id="add-rows" type="text" value="">
<input name="add-submit" id="add-submit" type="submit" value="Add" />
</form>
below are the values i'll be posting from the form, the rest of values can be setas NULL
$add_name = $_POST['add-name'];
$add_start = $_POST['add-start'];
$add_end = $_POST['add-end'];
$add_rows = $_POST['add-rows']; //in this case, the value is 32
this is the query... i'd need to enter 32 VALUES.
mysql_query("INSERT INTO table position, name, start, end, code, one, two, three, four, five, six)
VALUES (NULL, '$add_name', '$add_start', '$add_end', NULL, NULL, NULL, NULL, NULL, NULL, NULL)")
or die(mysql_error());
mysql_*functions anymore and consider switching to MySQLi oder PDO instead.