PHP Ajax Update MySQL Data Through Bootstrap Modal

Поделиться
HTML-код
  • Опубликовано: 10 сен 2024
  • How to update mysql data through a Bootstrap modal by using PHP with Ajax JQuery. Bootstrap modal With Edit data in Php Mysql and Ajax. PHP MySQL CRUD Operations using jQuery with Ajax and Bootstrap modal. Bootstrap Modal with AJAX crud data from MySQL with PHP. Update Mysql table data with Bootstrap Modal by using PHP with Ajax Jquery. Source Code - www.webslesson....

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

  • @harjindermankoo2667
    @harjindermankoo2667 5 лет назад

    Fantastic. Thanks very much for such a detailed and superb example of bootstrap, php using modal window. Exactly what I was looking for. Clear and concise although robotic voice sounds a bit dodgy but you get used to it

  • @abdulkhuddus4985
    @abdulkhuddus4985 5 лет назад

    Thanks for good explanation and its clear my doubts, may god bless you

  • @sircmcon
    @sircmcon 7 лет назад +1

    Excelente tutorial! Parabéns! Congrats!

    • @webslesson
      @webslesson  7 лет назад

      This is the output of our spending time of this work. Thanks Tuco.

  • @thanks_God_ForEverything
    @thanks_God_ForEverything 3 года назад

    Great Work Thanks for such a great stuff

  • @westfield90
    @westfield90 6 лет назад

    Does anyone know how you can change the modal header title to show the name of the employee whose data you are editing. I just can’t figure out how to get the name from Json and display it in the H3 html tag?

  • @rogerp.catamcojr.8483
    @rogerp.catamcojr.8483 Год назад

    wow i love it , great tutorial

  • @emaanali3065
    @emaanali3065 4 года назад

    When i put json infront of dataType it won't show me a table but if i replace dataType with Html is show me the table with the table field empty why it is so?

  • @marvinsaquic7569
    @marvinsaquic7569 4 года назад

    Gracias, muy buen video.

  • @ezerbautista5305
    @ezerbautista5305 5 лет назад

    Thanks for this, It helps a lot!

  • @itzy23
    @itzy23 5 лет назад

    Men i need to fix the update and add function same as the problem of others. When we first update then add it just updated the last data we updated. Please help ASAP.

  • @westfield90
    @westfield90 6 лет назад

    This doesn't work with bootstrap 4x and JQuery 3x. Does anyone know how to make it work with those newer files?

  • @yuneshshrestha9864
    @yuneshshrestha9864 4 года назад

    @weblesson my . modal ('show') is not working... please help

  • @anilshrestha4618
    @anilshrestha4618 4 года назад

    sir my .modal("show") is not working...could you please tell be the solution for this?

  • @jonice4229
    @jonice4229 4 года назад

    But if my select coming from database how do you make as selected?

  • @zutubanger
    @zutubanger 4 года назад +4

    Can you please make an effort to talk with your own voice that god has given you?

  • @arbabkhan9149
    @arbabkhan9149 6 лет назад

    +webslesson how can i add data table for this project where can i make changes for this?

  • @ameurovic
    @ameurovic 6 лет назад

    hello my friends. i had copied all the code above but unfaithefully the two buttons won't work.
    (the modal does n't appears, i copied the scripts)
    please help me to solve it. thanks alot.

  • @rachidchiouar2378
    @rachidchiouar2378 4 года назад +1

    thankyou for all your developments, this one is brilliant. it seem since two weeks, datatables doesen't work no more, i didn't do any change to the source, can you help?

  • @technokasim
    @technokasim 4 года назад

    Great bro you are awesome 😍

  • @joannamariereyes3616
    @joannamariereyes3616 7 лет назад +3

    it has a lil bit of error to me. when i run the program it works fine, i "edit" my data and it works fine but when i click "add" after editing, the details i add just upgrading the last data i edit. what seems to be the problem?!

  • @ShahAlam-nq7fs
    @ShahAlam-nq7fs 7 лет назад

    I have used this table
    But search option not work after data update.
    if refresh then work well

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

    do you have tutorial about autocomplete multiple field inside modal forms

  • @lakshitha2012
    @lakshitha2012 3 года назад

    sir! no data insert to database and no display result

  • @andaopirizkynugraha3534
    @andaopirizkynugraha3534 3 года назад

    Thank you very much,,

  • @jooliena
    @jooliena 4 года назад

    very nice tutorial. it's working ^_^

  • @tandat4619
    @tandat4619 7 лет назад

    Thank You. it works for me

    • @webslesson
      @webslesson  7 лет назад +1

      It's My pleasure, Tan Dat.

  • @erlynnavarrete8467
    @erlynnavarrete8467 7 лет назад

    I need help, in
    my database I have a column named Names and accept special characters of
    the Spanish language, such as ñ, ü, é, á, í, ó, ú, however when I click
    on edit the form does not load. It seems that #Json does not accept special characters

  • @onnewf9288
    @onnewf9288 4 года назад

    Thank you sir, but one more thing, would you please add how to update with dropdown selection which coming from php loops (foreach) ?

  • @Furyki
    @Furyki 7 лет назад

    How To Prevent Modal From Closing After Clicking a Submit Button ? ..

  • @MCB-dh7fp
    @MCB-dh7fp 5 лет назад

    Hello... thanks for a very wonderful tutorial... but i just have a quick query? i am trying to integrate this to my project but why i can not edit? can you please help me?

  • @nandalals9441
    @nandalals9441 6 лет назад

    Hi Sir Thankyou Very much ...... Here i noticed in the database table called "tbl_employee" you already created the "image" field. But you never using it for this CRUD process. Will you please update that image upload section too in this module.

  • @ISOnepal
    @ISOnepal 4 года назад

    Can we do it with pure javascript?

  • @winstonsimon8001
    @winstonsimon8001 6 лет назад

    anyone can help me with this problem. because i want to edit some data with the corresponding image or file. thanks a lot

  • @westfield90
    @westfield90 6 лет назад

    This is an excellent tutorial. But trying to adapt it to my table is maddening since there are too many uses of the 'id' tag. Each data field in a form as an id tag. Then you have 'id' as the column name in the database and then you have a variable called 'employee_id'. In my case my database column is 'form_id' and trying determine which of your fields should be changed to my name is difficult since you have two uses of the 'id' term. I've tired but all it does when I click the edit button is that it inserts a new record and never edits the record. So obviously I'm missing something where the id should have been left as id.

  • @hardikchaturvedi7289
    @hardikchaturvedi7289 7 лет назад

    sir please tell when I update a row only first row is updating

  • @philipmanetas
    @philipmanetas 6 лет назад +1

    Hello @weblesson, thank you for these videos ;) I want to point out a bug in your code. After clicking "Update" button in the popup update form, it refreshes the page instead of using ajax's success callback function. To fix this, you need to change button's input type from "submit" to "button" & javascript
    from: $('#insert_form').on("submit", function(event){
    TO $('#insert').on("click", function(event){
    i don't know why, but the preventDefault's function call didn't work and i needed to make the above adjustments.
    again, thank you for your tutorials ;)

  • @ilivesafi7889
    @ilivesafi7889 6 лет назад

    hey. this is a very good work. thanks a lot. but, can you show us how we can add a picture with all the employee database... and show all in the modal. im not able to do it... thanks

  • @bharatarora640
    @bharatarora640 5 лет назад

    it is really good..

  • @rupeshparihar
    @rupeshparihar 2 месяца назад

    thanks

  • @khannsothea2621
    @khannsothea2621 6 лет назад

    it error to me. when i run the program it works,but when i "edit" my data and it works fine but when i click "add" after editing, the details i add just upgrading the last data i edit. what seems to be the problem?!

    • @ramakantabisipa3221
      @ramakantabisipa3221 6 лет назад

      Khann Sothea did you solve the problem?

    • @khannsothea2621
      @khannsothea2621 6 лет назад

      alreay thank

    • @ramakantabisipa3221
      @ramakantabisipa3221 6 лет назад

      me too :) cheers

    • @reast07
      @reast07 4 года назад

      @Saif Kunda , hi mr Saif, hope this can help you.. tq
      hi all, i have fixed bugs for updates records. 100% solved the "update" issues :D
      here is my code:
      1. modify edit button at employee tables

      PHP Ajax Update MySQL Data Through Bootstrap Modal



      Add





      Employee Name
      Edit
      View
      View

  • @chesteringco3365
    @chesteringco3365 7 лет назад

    please help, when i click the button, the modal is not showing.. i don't know what causes the problem.

    • @chesteringco3365
      @chesteringco3365 7 лет назад

      nvm I found what's wrong :D thanks for the tutorial man..

    • @webslesson
      @webslesson  7 лет назад

      Thankyou Chester Ingco, have a nice day!

    • @yuneshshrestha9864
      @yuneshshrestha9864 4 года назад

      @@chesteringco3365 hey could you give me solution for this problem?

  • @mujahidsac7159
    @mujahidsac7159 7 лет назад

    I followed your tutorial even copied the script, changed it a little to suite my database and table, but when clicking the edit button, the dialog is empty. Why is that? Please help.

    • @webslesson
      @webslesson  7 лет назад

      Hi Mujahid Sac, you have to change value of hidden action field in jquery code when you have click on Edit button, and in edit button click event jquery code you have to change value of action variable value from 'Add' to 'Edit'. So please try it.

    • @mujahidsac7159
      @mujahidsac7159 7 лет назад

      Webslesson yeah, checked that. It works now. But It doesn't instantly refresh, only after I refresh the page it displays the updated or added data and updates it into the db. Why is that? Another question, how can I add a delete button that works with the jQuery you are using. If I add another version of jQuery, the whole thing doesn't work.

  • @ameerhamza4373
    @ameerhamza4373 7 лет назад +1

    Hello !
    I have an issue that when i click on edit button the data is filled in all rows correctly but when after clicking on edit button when i click on add button then my add_data_Modal fields also contains that data !
    Means that my add button also behave like edit button !!!
    Kindly reply fast plzzzz

    • @webslesson
      @webslesson  7 лет назад

      Hi Hamza Mughal, when you have submit form data, then after all form fields must be clear, for clear all form field you have to write this code - $(form id)[0].reset(); By using this code you can clear form and when you again click on add button all fields will be clear.

    • @ameerhamza4373
      @ameerhamza4373 7 лет назад +1

      But there is another issue also that when i click on edit button and close the modal without doing any thing then my add button also behave like edit button ? :(

    • @ameerhamza4373
      @ameerhamza4373 7 лет назад

      i'm check your code that you have provided on your website but i am not able to resolve that issue!

    • @Zephryable
      @Zephryable 7 лет назад +1

      I solve this problem
      check Modal dismiss
      and reset form
      $('#ModalName').on('hidden.bs.modal', function(){
      $('#insert-form')[0].reset();
      });

    • @ameerhamza4373
      @ameerhamza4373 7 лет назад

      Zephryable i will check and thanks in advance

  • @rohith6xt
    @rohith6xt 4 года назад

    My id value show it is undefined in

  • @gilangprasetioo2301
    @gilangprasetioo2301 6 лет назад

    'thank you for your explain about update, but i found the little problem when show alert "Data Inserted" become "Data Updated", you should add variable '$message' in between tag button alert.
    '.$message.'
    thank you, i am from indonesian

  • @MegalaiMaranMurali
    @MegalaiMaranMurali 7 лет назад

    Thank You Sir......................

    • @webslesson
      @webslesson  7 лет назад

      Thanks...

    • @nsis5095
      @nsis5095 7 лет назад

      I found error on this code...maybe something is missing. When I Edit data and Save then it is working, the data is updated but when I go directly to Add it will edit the previous data I have edited instead of adding new record...I also tried the demo but the error is also there.

  • @diamondnd4258
    @diamondnd4258 7 лет назад +1

    can u give me the code for 'delete data'?? it would be great ..
    And amazing job Weblesson!!

    • @Votlon
      @Votlon 4 года назад

      rm -rf /

  • @click4rajesh823
    @click4rajesh823 4 года назад

    Also how to edit image field and update it.

  • @kongkimha9078
    @kongkimha9078 7 лет назад +1

    you can show delete file row , i can't delete

  • @davidmukoro1166
    @davidmukoro1166 7 лет назад +1

    This is awesome!. However, you did not show any Delete. Recall it is CRUD. What about the D in the CRUD?. We will appreciate the tutorial as well.

    • @webslesson
      @webslesson  7 лет назад

      Thanks David...

    • @Kidsfun1414-d5x
      @Kidsfun1414-d5x 7 лет назад

      would you plz give the delete code with this tutorial source code

    • @ramakantabisipa3221
      @ramakantabisipa3221 6 лет назад

      $(document).on('click', '.delete', function(){
      var branch_id = $(this).attr("id");
      var el = this;
      if(confirm("Are you sure you want to delete this?"))
      {
      $.ajax({
      url:"delete_branch.php",
      method:"POST",
      data:{branch_id:branch_id},
      success:function(data)
      {
      $(el).closest('tr').css('background','#de6f6c');
      $(el).closest('tr').fadeOut(800, function(){
      $(this).remove();
      });
      }
      });
      }
      else
      {
      return false;
      }
      });
      This will work fine. Go for it.

    • @thomasdeclercq8471
      @thomasdeclercq8471 4 года назад

      @@ramakantabisipa3221 thank you works fine!

  • @westfield90
    @westfield90 6 лет назад

    So I've figured out the answers to my previous two posts so please ignore them

  • @khannsothea2621
    @khannsothea2621 6 лет назад

    thank bro it now it work

  • @luismanjarres9778
    @luismanjarres9778 7 лет назад

    help me please, I want the registration form to be different from the update form

    • @webslesson
      @webslesson  7 лет назад

      Hi Luis, we have already make this type of video tutorial, please search in our channel you can find this tutorial.

  • @nomi094
    @nomi094 7 лет назад

    Sir on view i also want to load image in modal from database
    can you purpose me a sloution????

    • @webslesson
      @webslesson  7 лет назад

      Simply you can add image tag with image source link get from database and put in image tag and you can easily show image in modal from database.

    • @nomi094
      @nomi094 7 лет назад

      sir in edit modal i want to add a change image field and want to display previous image from database
      please help me out on this

  • @rw7799
    @rw7799 7 лет назад

    very detailed but tbf just use 1 input so i can get an idea what your doing.... to much info to take in...

  • @johncarlopalaming7138
    @johncarlopalaming7138 6 лет назад

    No delete tutorial?

  • @patrickjudeferrariz8682
    @patrickjudeferrariz8682 6 лет назад

    i need the video how u make the database

  • @markjosephsulla601
    @markjosephsulla601 7 лет назад

    hi can u make a tutorial CRUD data with IMAGE through modal using php, please thankss

    • @webslesson
      @webslesson  7 лет назад

      Hi Mark Joseph Sulla, We have already made this type of tutorial, so please search on our channel you can find this type of tutorial also.

    • @markjosephsulla601
      @markjosephsulla601 7 лет назад

      thanks very much Webslesson.

  • @gafoundationlimited8782
    @gafoundationlimited8782 7 лет назад

    dear bro, this tutorial is not work. when i run it

    • @webslesson
      @webslesson  7 лет назад

      Have you follow source code of this video?

  • @mindrevenge896
    @mindrevenge896 7 лет назад

    Hi, when i click on "edit" button, nothing happen. Any ideia?
    great video btw.

  • @Kidsfun1414-d5x
    @Kidsfun1414-d5x 7 лет назад

    would you plz give the delete code with this tutorial source code

    • @ramakantabisipa3221
      @ramakantabisipa3221 6 лет назад

      $(document).on('click', '.delete', function(){
      var branch_id = $(this).attr("id");
      var el = this;
      if(confirm("Are you sure you want to delete this?"))
      {
      $.ajax({
      url:"delete_branch.php",
      method:"POST",
      data:{branch_id:branch_id},
      success:function(data)
      {
      $(el).closest('tr').css('background','#de6f6c');
      $(el).closest('tr').fadeOut(800, function(){
      $(this).remove();
      });
      }
      });
      }
      else
      {
      return false;
      }
      });
      This will work fine. Go for it.

  • @nahidulislam9502
    @nahidulislam9502 4 года назад

    Please use original voice

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

    php àjax update mysql data through bootstrap tabs/pills

  • @shraddhatapase9349
    @shraddhatapase9349 7 лет назад

    Add delete code in this tutorial

    • @ramakantabisipa3221
      @ramakantabisipa3221 6 лет назад +1

      $(document).on('click', '.delete', function(){
      var branch_id = $(this).attr("id");
      var el = this;
      if(confirm("Are you sure you want to delete this?"))
      {
      $.ajax({
      url:"delete_branch.php",
      method:"POST",
      data:{branch_id:branch_id},
      success:function(data)
      {
      $(el).closest('tr').css('background','#de6f6c');
      $(el).closest('tr').fadeOut(800, function(){
      $(this).remove();
      });
      }
      });
      }
      else
      {
      return false;
      }
      });
      This will work fine. Go for it.

  • @bozkurt6264
    @bozkurt6264 4 года назад

    hate this robot sound

  • @smurffronda2951
    @smurffronda2951 3 года назад

    thanks