thumbelina
Programmer
ok i have a table with the fields entryID(auto_increment), date, regularhours, othours, project. I have a form on which u can enter info into each field. I have it set up so that u can enter 5 records into the database at once. So that means in a line 3 text boxes and one drop down list, then 5 lines all the same in the form.when u hit the submit button it should send the info to the table. I have each query put into an if block so that it will only send info if there is info entered in the date text box. the if blocks look like this:
<?php if(!isset($dateone)) { ?>
<?php } else {
$database = databasename;
$sql = "INSERT INTO EmployeeWork (entryID,workdate,reghrs,ot,project) VALUES ('','$dateone','$regularone','$otone','$projectone')";
$do = mysql($database,$sql) or die("failed to issue query"
}
?>
but the problem is that if there is info in one line of the form it will enter 4 blank records, but if i fill in all 5 lines in the form it just enters the 5 records properly. what am i doing wrong?? Thanks for your help.
<?php if(!isset($dateone)) { ?>
<?php } else {
$database = databasename;
$sql = "INSERT INTO EmployeeWork (entryID,workdate,reghrs,ot,project) VALUES ('','$dateone','$regularone','$otone','$projectone')";
$do = mysql($database,$sql) or die("failed to issue query"
}
?>
but the problem is that if there is info in one line of the form it will enter 4 blank records, but if i fill in all 5 lines in the form it just enters the 5 records properly. what am i doing wrong?? Thanks for your help.