PHP SQL Update Query

In this example a delete flag is cleared associated with a database entry is cleared.

$dbuser="username";
$dbpass="password";
$dbname="mydata"; //the name of the database
$chandle = mysql_connect("localhost", $dbuser, $dbpass)
or die("Connection Failure to Database");
mysql_select_db($dbname, $chandle) or die ($dbname . " Database not found. " . $dbuser);
$mainsection="links"; //The name of the table where web links are stored
$deletef=0;
$query1="update " . $mainsection . " set deletef=" . $deletef . " where id = " . $delete_link[$i1];
mysql_db_query($dbname, $query1) or die("Failed Query of " . $query1);
echo "Link with ID " . $delete_link[$i1] . " has had the delete flag cleared and will not be deleted.<br>";