I am trying to write a script to handle event registration. Most of the people that will be registering are already in the database, but not all, and those that are may not have current information. Here is my latest effort, or at least a snippet of it... Can anyone point out where I went stupid, or if there is a better way of doing this? THANKS!!! <<<===--- BEGIN SNIPPET ---===>>> $db = @mysql_select_db($dbname, $connection) or die("Couldn't Select Database."); $link = mysql_connect("$server", "$user", "$pass"); mysql_select_db("$dbname", $link); $result = mysql_query("SELECT * FROM $table WHERE first_name='$first_name' AND hs_last_name='$hs_last_name' AND last_name='$last_name'", $link); $num_rows = mysql_num_rows($result); if($num_rows) { $sql = "UPDATE $table SET first_name=\"$first_name\", last_name=\"$last_name\", hs_last_name=\"$hs_last_name\", guest_name=\"$guest_name\", street_address1=\"$street_address1\", street_address2=\"$street_address2\", city=\"$city\", state=\"$state\", zip=\"$zip\", phone1=\"$phone1\", phone2=\"$phone2\", email_address=\"$email_address\", number_attending=\"$number_attending\", payment=\"$payment\", registration_comments=\"$registration_comments\", date_registered=\"$today\" WHERE first_name=\"$first_name\" AND last_name=\"&last_name\""; $result = @mysql_query($sql,$connection) or die("Couldn't Execute Query."); } else { $sql = "INSERT INTO $table (first_name, last_name, hs_last_name, guest_name, street_address1, street_address2, city, state, zip, phone1, phone2, email_address, number_attending, payment, registration_comments, date_registered) VALUES (\"$first_name\", \"$last_name\", \"$hs_last_name\", \"$guest_name\", \"$street_address1\", \"$street_address2\", \"$city\", \"$state\", \"$zip\", \"$phone1\", \"$phone2\", \"$email_address\", \"$number_attending\", \"$payment\", \"$registration_comments\", \"$today\") "; $result = @mysql_query($sql,$connection) or die("Couldn't Execute Query."); <<<===--- END SNIPPET ---===>>> -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php