>> PHP: Delete Query
Update Page: Execute update Continued….... After the user changes the information and presses update Use the POST method to update the items by running the Update Query Display the message for success/failure selectively as we did earlier HINT: Use the same approach as the INSERT QUERY
Update Image Two cases If Image is updated If Image not updated Image Updated Image Not Updated If Image is updated Same steps as UPLOAD IMAGE Use $_FILES Associative Array If Image not updated How to know if image was not updated?
Image Not Updated Check if $_FILES is not set? Will this work? No. If enctype is set, the $_FILES is sent but empty Other Approach Check if $_FILES is empty Cannot check if the whole array is empty Check if any one of the dimension is empty For example $_FILES[‘name’] === “”
Delete Query Within the same page as modify-item.php, write code for delete (use isset($_POST[‘delete’]) Run the Delete Query Display confirmation that the item was deleted successfully ISSUE: How to delete uploaded files? if(file_exists($img)) { unlink($img); }