The following code is supposed to insert a row into table1, but the output I get for mysql_affected_rows() is -1 and in fact, the row is not inserted. I'm not getting any error messages. What am I doing wrong?
<?PHP
$first = $_POST["first"];
$last = $_POST["last"];
$addr = $_POST["Addr"];
$city = $_POST["city"];
$state = $_POST["state"];
$zip = $_POST["zip"];
$phone = $_POST["phone"];
$db = mysql_connect("Dev-1", "root", ""
;
mysql_select_db("db1", $db);
$sql = "Insert into table1 (First, Last, Addr, City, State, zip, Phone)
Values ($first, $last, $addr, $city, $state, $zip, $phone)";
mysql_query($sql, $db);
printf ("Updated records: %d\n", mysql_affected_rows());
mysql_query("COMMIT"
;
?>
<?PHP
$first = $_POST["first"];
$last = $_POST["last"];
$addr = $_POST["Addr"];
$city = $_POST["city"];
$state = $_POST["state"];
$zip = $_POST["zip"];
$phone = $_POST["phone"];
$db = mysql_connect("Dev-1", "root", ""

mysql_select_db("db1", $db);
$sql = "Insert into table1 (First, Last, Addr, City, State, zip, Phone)
Values ($first, $last, $addr, $city, $state, $zip, $phone)";
mysql_query($sql, $db);
printf ("Updated records: %d\n", mysql_affected_rows());
mysql_query("COMMIT"

?>