Page 1 of 1

problem with update query

Posted: Tue May 19, 2009 4:21 pm
by rbroadwe

Code: Select all

if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
 
 
$sql = 'UPDATE appt
        SET fname = "$fname", lname = "$lname", street = "$street", zip = "$zip", phone = "$phone", problem = "$problem", booked = "Y"
        WHERE id="$id"';
 
mysql_select_db("robbroa1_fox", $con);
$retval = mysql_query( $sql, $con );
if(! $retval )
{
  die('Could not update data: ' . mysql_error());
}
echo "Updated data successfully\n";
mysql_close($con);
it doesn't error and it echos that it worked but it doesn't update the rows and I dont know why. Does anyone see the problem? Thank you!

Re: problem with update query

Posted: Tue May 19, 2009 4:25 pm
by Benjamin
You posted the same question already. Don't double post. Locked