Sql query problem
Posted
by LiveEn
on Stack Overflow
See other posts from Stack Overflow
or by LiveEn
Published on 2010-03-30T13:13:23Z
Indexed on
2010/03/30
14:33 UTC
Read the original article
Hit count: 429
I have the below sql query that will update the the values from a form to the database
$sql="update leads set category='$Category',type='$stype',contactName='$ContactName',email='$Email',phone='$Phone',altphone='$PhoneAlt',mobile='$Mobile',fax='$Fax',address='$Address',city='$City',country='$Country',DateEdited='$today',printed='$Printed',remarks='$Remarks' where id='$id'";
$result=mysql_query($sql) or die(mysql_error());
echo '<h1>Successfully Updated!!.</h1>';
when i submit I dont get any errors and the success message is displayed but the database isnt updated . When i echo the $sql, all the values are set properly. and when i ech the $result i get the value 1.
can someone please tell me what am i doing wrong here??
© Stack Overflow or respective owner