I have a PHP page called insert.php that inserts records via a page with a form named index.php. It works perfectly well but I can only add one record at a time. I would like to rewrite both scripts so that I can add many records a once and not one at a time. I am an absolute newbie and is completely stumped. Any ideas?
Insert,php
--------------------------------------
<?php
// Create connection
$con=mysqli_connect("localhost","root","password","results");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sql="INSERT INTO 2014 (Pos,FirstName, LastName, Prov, Perf, Wind, Gender, Agegroup, Event, DOB, Meet, Venue, Date )
VALUES
('$_POST[pos]','$_POST[firstname]','$_POST[lastname]','$_POST[prov]','$_POST[perf]','$_POST[wind]','$_POST[gender]','$_POST[agegroup]','$_POST[event]','$_POST
[dob]','$_POST[meet]','$_POST[venue]','$_POST[date]')";
if (!mysqli_query($con,$sql))
{
die('Error: ' . mysqli_error($con));
}
echo "1 record added";
mysqli_close($con);
?>
---------------------------------------------------
index.php
<html>
<body>
<form action="insert.php" method="post">
Pos: <input type="text" name="pos">
Firstname: <input type="text" name="firstname">
Lastname: <input type="text" name="lastname">
Prov: <input type="text" name="prov">
Perf: <input type="text" name="perf">
Wind: <input type="text" name="wind">
Gender: <input type="text" name="gender">
Agegroup: <input type="text" name="agegroup">
Event: <input type="text" name="event">
DOB: <input type="text" name="dob">
Meet: <input type="text" name="meet">
Venue: <input type="text" name="venue">
Date: <input type="text" name="date">
<input type="submit">
</body>
</html>