About 2/3 of the way through this little script are lines of stars. Those mark comments for this post. I have a small error checking line for duplicate records, however, I would like the user to have the ablility to go ahead and add the record if they want, even if its a duplicate.
$query=("SELECT * FROM Info WHERE first = '$first'");
$data=mysql_query($query);
$returned = mysql_num_rows($data);
if ($returned == 0){
$insert = ("INSERT INTO Info (first, last, street1, street2, city, state, zip, email, parent_id, dob, spouse, hphone, wphone, cphone, fax, spouse_dob, mdate) VALUES('$first', '$last', '$street1', '$street2', '$city', '$state', '$zip', '$email', '$parent', '$dob', '$spouse', '$hphone', '$wphone', '$cphone', '$fax', '$spousedob', '$mdate')");
mysql_query($insert)
or die(mysql_error());
echo "Record Added.<br>";
echo "<p><a href=enteradd.php>Add Another?</a><br>";
} else {
echo "We already show a record for $first. Add this one anyway?
I am trying to make this a link that will go ahead and perform the mysql_query function to insert this record
<a href=mysql_query($insert)>Yes</a>";
}
echo "<p><a href=search.html>Return to search screen.</a>";