fetch(PDO::FETCH_NUM); //get attachments $stH = stPrep(" SELECT `attach` FROM `events` WHERE `ID` = ?"); stExec($stH,array($evtID)); $row = $stH->fetch(PDO::FETCH_NUM); $attachments = $row[0]; $stH = null; //remove attachment $attachments = str_replace(";{$fName}",'',$attachments); //remove //update event $stH = stPrep("UPDATE `events` SET `attach` = ?,`editor` = ?,`mDateTime` = ? WHERE `ID` = ?"); stExec($stH,array($attachments,$uName,date("Y-m-d H:i"),$evtID)); //update events table //Delete file from folder attachments if(file_exists("./attachments/{$fName}")) { unlink("./attachments/{$fName}"); } echo ''; ?>