What is wrong with my php/sql command?

  • Thread starter Thread starter mysecretunfortunatelife
  • Start date Start date
M

mysecretunfortunatelife

Guest
$sql = mysql_query("UPDATE `alpha` SET
`first name` = '".$_POST['retfirst']."'
`last name` = '".$_POST['retlast']."'
`mobile` = '".$_POST['retmod']."'
`homephone` = '".$_POST['rethomo']."'
WHERE `id` = '".$_POST['retid']."'") or die(mysql_error());


thankss..
 
You forgot the commas after each field.

$sql = mysql_query("UPDATE `alpha` SET
`first name` = '".$_POST['retfirst']."',
`last name` = '".$_POST['retlast']."',
`mobile` = '".$_POST['retmod']."',
`homephone` = '".$_POST['rethomo']."'
WHERE `id` = '".$_POST['retid']."'") or die(mysql_error());
 
Back
Top