till now everythin gworks well but i have a problem in update syntax
i have a syntax error in update and i can not modify it
can u help me?
$qryp = "UPDATE hotels SET
Hotel_Name='$hotel_name',
Tel='$tel',
Tel2='$tel2',
Fax= '$fax',
Contact_Person='$contact_person',
E-mail='$emal',
Notes='$notes'
WHERE id=$id";
1- i made a form and i post its value in this page
2- i echoed these values in my page so it works well
3- but i have a syntax error in mysql statment and i can not modify it
can u help me?
my code is:
<?
$id = $_POST["id1"];
echo ("$id");
$hotel_name=$_POST["hotel_name"];
echo ("$hotel_name");
$tel=$_POST["tel"];
$tel2=$_POST["tel2"];
$fax=$_POST["fax"];
$contact_person=$_POST["contact_person"];
$emal=$_POST["emal"];
$notes=$_POST["notes"];
?>
<?
///// 3. Perform database query
$qryp = "UPDATE hotels SET
Hotel_Name='$hotel_name',
Tel='$tel',
Tel2='$tel2',
Fax= '$fax',
Contact_Person='$contact_person',
E-mail='$emal',
Notes='$notes'
WHERE id=$id";
print "qryp: " . $qryp . "<br>";
$result = mysql_query($qryp)
or die ("table error: " . mysql_error());
while ($tr_res = mysql_fetch_array($result)){
//echo $tr_res["id"] ;
}
?>