Iam deleting a record from the database and trying to delete the associated images, the main full size image and the thumbnail. I can delete the database entry and the big image but don't know how to add a prefix to the thumbnail delete part. I want it to be "th" before the second FILE_NAME so it deletes the thumbnail image as well. Please see code below:
chdir('../gallery/');
$do = unlink($row_Recordset1['FILE_NAME']);
$do = unlink($row_Recordset1['FILE_NAME']);
if($do=="1"){
header(sprintf("Location: cpanel.php"));
} else { echo "There was an error trying to delete the file."; }