I’m trying to add a value to a row in a database table that currently has other values. I want to effect only one field in the table. here’s what I’m doing:
$sql = "UPDATE users SET photo = ".$m_fname." WHERE pin = ".$_SESSION['pin'].";";
What’s the correct way to do this?
Here’s a little more:
$m_fname = mysql_real_escape_string($dest_filename);
$sql = "UPDATE users SET photo = ".$m_fname." WHERE pin = ".$_SESSION['pin'].";";
$res = @mysql_query($sql);
if (!$res) {
$errors[] = "Could not run query.";
break;
}
Before anyone else downvotes..
I’m aware I should be using mysqli. Sorry if I offended anyone by using an old function.
1 Answer