Delete Multiple Records In MySQL By Selecting Checkbox Using PHP

Поделиться
HTML-код
  • Опубликовано: 19 мар 2022
  • Delete Multiple Selected Data/Rows/Records In A Table MySQL Database By Selecting Checkboxes Using PHP | PHP MySQL
    More Videos :
    - Create Login & Registration Form PHP MySQL With Login & Logout Session = • Create Login & Registr...
    - Create A PHP Voting Form & Insert Form Data to MySQL Database | HTML CSS jQuery PHP MySQL = • Create A PHP Voting Fo...
    - Upload Images to Website, Store to Database & Display It with Validation Using PHP & MySQL = • How To Upload Image In...
    - Insert HTML Form Into MySQL Using jQuery Ajax PHP = • Insert HTML Form Data ...
    Source Code = github.com/davidgrcias/delete...
    Contact :
    Gmail = davidgarciasaragih7@gmail.com
    GitHub = github.com/davidgrcias​
    Instagram = / davidgrcias
    Donate To Support :
    - paypal.me/davidgtech
    - sociabuzz.com/davidgtech/donate
    Music :
    1. Track: NIVIRO - Flares [NCS Release]
    Music provided by NoCopyrightSounds.
    Watch: • NIVIRO - Flares | Hous...
    Free Download / Stream: ncs.io/FlaresYO
    2. Track: Jim Yosef - Lights [NCS Release]
    Music provided by NoCopyrightSounds.
    Watch: • Jim Yosef - Lights | H...
    Free Download / Stream: ncs.io/lights
    Thank you for watching

Комментарии • 13

  • @edgardidiercoronaventura9235
    @edgardidiercoronaventura9235 2 года назад +2

    Thanks a lot! I've figting with this for a long time
    I just add some code to don't get problems when there is no one selected
    if(empty($_POST['deleteId'])){
    echo " alert('No one is selected'); ";
    }
    else{

    • @DavidGTech
      @DavidGTech  2 года назад +1

      Awesome!!! You're welcome...

  • @ayowaleojo8491
    @ayowaleojo8491 2 года назад +1

    Thanks it worked but only the first items are deleting if I try to delete the last item it will just refresh the page. and sometimes I will get deleteID is not defined but the first items in the list are always deleted. is there a solution for this ?

    • @DavidGTech
      @DavidGTech  2 года назад

      Make sure that there are no missing codes in your code

  • @fahiyangtech
    @fahiyangtech Год назад +1

    submit bulk with Checkbox , can you give me tutorial plessee master

  • @phph2021
    @phph2021 5 месяцев назад +1

    hi sir, how to add SweetAlert2 to confirm delete in this exemple? thx

    • @DavidGTech
      @DavidGTech  Месяц назад

      Hi @phph2021! To add SweetAlert2 for delete confirmation, include the SweetAlert2 library in your project and replace your delete button's onclick function with a SweetAlert2 confirmation dialog. When confirmed, proceed with the delete action.

  • @jovenis2572
    @jovenis2572 11 месяцев назад +1

    I have a problem with this program code..... For example; I have Id "TH1, TH2, TH3, TH4" but I can't use multiple deleted with checkbox, but if my Id is "1, 2, 3, 4" I can use multiple deleted with checkbox...... So what do you do? my solution if i have Id "TH1, TH2, etc"???

    • @DavidGTech
      @DavidGTech  11 месяцев назад

      Hi Jovenis,
      Thank you for reaching out and sharing your concern about the program code. I appreciate your engagement with the content.
      It looks like you are facing an issue with using multiple deletions with checkboxes when the IDs are in the format "TH1, TH2, etc." As you've rightly pointed out, the current implementation works well when IDs are in the format "1, 2, 3, 4."
      To address this, we need to adjust the code to handle IDs in both formats. One approach could be to convert the "TH1, TH2, etc." IDs to their corresponding numeric values (e.g., "TH1" becomes "1") before performing the deletion process.
      Here's a general outline of how you can achieve this:
      - Modify the PHP code that processes the checkboxes and extracts the selected IDs.
      - Check if the IDs are in the "THX" format or numeric format. If they are in the "THX" format, convert them to numeric format.
      - Perform the deletion based on the converted numeric IDs.
      Remember to handle any validation or error-checking during the conversion process to ensure the data integrity.
      If you need specific code snippets or further guidance, please let me know. I'd be happy to help you with the implementation.
      Again, thank you for raising this issue, and I'm here to support you in resolving it.

    • @jovenis2572
      @jovenis2572 11 месяцев назад +1

      @@DavidGTech Thanks you

    • @DavidGTech
      @DavidGTech  11 месяцев назад

      You're much welcome!!!

  • @jinshin.19
    @jinshin.19 Год назад

    You checked the number of 2 and 3 but the number got deleted was the 3 and 4 not the 2 - 3

    • @DavidGTech
      @DavidGTech  Год назад

      Please double-check the code shown in the video, especially the part related to deleting records. Ensure that you have correctly implemented the logic for selecting and deleting the desired checkboxes.