The code I've come up with so far is below. Basicly I want to have the ability to add more than one row per submit. I've tried to loop this code and concat a vaiable e.g. $x = 0 then loop $number.$x which didn't work. Here is my current setup of my insert.htm submit page.
Number Name Yards Rushing TD
field field field field
Submit button
for which my current code works great, but here is what I want to be able to enter into the table.
Number Name Yards Rushing TD
field field field field
field1 field1 field1 field1
field2 field2 field2 field2
etc. etc. etc. etc.
Submit button
I realize this may not be worded well, but I'd appreciate any help. If anyone needs more info please let me know. Thanks
insert.php below
<?
if (!$number || !$name || !$yards || !$rtd)
{
echo "You have not entered all the required details.<br>"
."Please go back and try again.";
exit;
}
$number = doubleval($number);
$name = addslashes($name);
$yards = doubleval($yards);
$rtd = doubleval($rtd);
@ $db = mysql_pconnect("localhost", "root");
if (!$db)
{
echo "Error: Could not connect to database. Please try again later.";
exit;
}
mysql_select_db("rush");
$query = "insert into players values ('".NULL."', '".$number."', '".$name."', '".$yards."', '".$rtd."')";
$result = mysql_query($query);
if ($result)
echo mysql_affected_rows()." book inserted into database.";
?>