Anyone know what's wrong with my code?
//
$db_name = "xxx";
$table_name = "contacts";
$connection = @mysql_connect("localhost", "xxx", "xxx") or die("Couldn't connect.");
$db = @mysql_select_db($db_name, $connection) or die("Couldn't select database.");
$sql = "UPDATE $table_name
SET
fname = \"$fname\",
lname = \"$lname\",
loan_officer = \"$loan_officer1\",
community = \"$community\",
comments = \"$comments\",
email_date = \"$email_date\",
email_address = \"$email\",
address= \"$addressl\",
city = \"$city\",
state = \"$state\",
zip = \"$zip\"
WHERE id = \"$id\"
";
$result = @($sql,$connection) or die("Couldn't execute query.");
//
I either get an error - "Couldn't execute query" - or the program acts like it has updated but when I look at the table in the db the update hasn't happened.
Any ideas?
Thanks
Mark