Presentation is loading. Please wait.

Presentation is loading. Please wait.

>> PHP: Delete Query

Similar presentations


Presentation on theme: ">> PHP: Delete Query"— Presentation transcript:

1 >> PHP: Delete Query

2 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

3 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?

4 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’] === “”

5 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); }


Download ppt ">> PHP: Delete Query"

Similar presentations


Ads by Google