Code: Select all
//Calls the last entry into the database
mysql_select_db($database_contacts, $missed_visits);
$query_missed = "SELECT * FROM missedVisit ORDER BY missed_id DESC limit 1";
$missed = mysql_query($query_missed, $missed_visits) or die(mysql_error());
$row_missed = mysql_fetch_assoc($missed);
$totalRows_missed = mysql_num_rows($missed);
//names and uploads the file
// $time = time()+1;
$filename = "\.\.\/\.\.\/images\/employees\/missedvisit\/".$row_missed['missed_id']."\_employee\.jpg";
imagejpeg($img, "$filename", 100);
imagedestroy($img);
$rootimg = "\.\.\/images\/employees\/missedvisit\/".$row_missed['missed_id']."\_employee\.jpg";
$id = $row_missed['missed_id'];
$updateSQL = "UPDATE missedVisit SET missed_image=".$rootimg." WHERE missed_id=".$id."";
$rsl = mysql_query($updateSQL);
set_msg('Record Added');
$cid = $row_missed['missed_id'];
$redirect = "../../missedvisit-details.php?id=$cid";
header('Location: '.$redirect); die;My problem is when I create the image and come through this file, it will create the jpg, store it as the correct file name with the correct location, but will not update the database. I suspect it is the concatenation or escape keys. What would be the proper syntax for this? The value is NULL each time. No Errors.