I want to save the path to the image file and the image name in one table, but, of course, separate fields. How can I execute it correctly? I am sure there is something significantly wrong in the code below, but I cannot notice it. Thank.
$sess_userid = mysql_real_escape_string($_SESSION['userid']);
$Image = mysql_real_escape_string($_FILES['file']['name']);
$PortraitPath = mysql_real_escape_string('profileportraits/' . $_FILES['file']['name']);
$query = "UPDATE Members
SET PortraitPath = '$PortraitPath'
WHERE fldID='$sess_userid'";
$query2 = "UPDATE Members
SET Image = '$Image'
WHERE fldID='$sess_userid'";
$result = mysql_query($query) or trigger_error(mysql_error().$query);
$result2 = mysql_query($query2) or trigger_error(mysql_error().$query2);
source
share