I wasn't sure if this should be in the MySQL or PHP forum. I have a database to enter student info for a school (it's a detention list - I'm the VP) I have a form to update records in a database as each student is assigned detention. It only allows me to enter one student at a time. Is there a way to enter multiple students? For example if 20 students have detention, I want to enter 20 students into the database at once. (the database is for my tracking purposes)
form.html
<form id="form1" name="Update" method="post" action="add.php">
<label>
First Name: <input type="text" name="fname" id="textfield" />
</label>
<br />
<label>
Last Name: <input type="text" name="lname" id="textfield2" />
</label>
<input name="" type="submit" value="send" />
</form>
add.php
<?php
$con = mysql_connect("localhost", "******", "*****");
if (!$con)
{
die('Could not connect to DB: ' . mysql_error() );
}
mysql_select_db ("*****", $con);
$sql="INSERT INTO items (fname, lname)
VALUES ('$_POST[fname]','$_POST[lname]')";
if (!mysql_query($sql,$con))
{
die ('Error: ' . mysql_error());
}
echo "Record added";
mysql_close($con)
?>
Also, is there a way to add a date to each entry automatically?
Thanks for any help