Insert Data Into MySQL Database using jQuery + AJAX + PHP

Поділитися
Вставка
  • Опубліковано 11 гру 2024

КОМЕНТАРІ • 254

  • @kennethcarlgalve
    @kennethcarlgalve 5 років тому +8

    The last time I watched this video is when I was still doing my thesis 4th year college of BSIT here in the Philippines. That was 2014, I graduated in March 2015. Wow, I'm feeling all the struggles I got back then while watching this video again. Thank you, Satish :)

    • @technotipDOTorg
      @technotipDOTorg  4 роки тому +2

      Feeling so happy for your progress bro. Praying for more successful years to you ..

  • @kraegandragon
    @kraegandragon 11 років тому

    Excellent video. I'm self-taught in PHP, Javascript, HTML5, Coldfusion and CSS. Now I'm tackling AJAX. Until this video, I did not fully understand the simplicity. Straight to the point and thank you for not spending wasted time on theory. Perfect. One thing that would make it better for me is to provide a place to download the code for copy and paste reasons.

  • @Maths4Everyone
    @Maths4Everyone 4 роки тому +1

    Even though this is quite an old video, it is still valid and is crystal clear and easy to follow. Thank you

    • @technotipDOTorg
      @technotipDOTorg  4 роки тому

      Thanks a lot for your good words Sir ..means a lot to me.

  • @technotipDOTorg
    @technotipDOTorg  11 років тому

    There maybe many ways of doing this ..but what I've done with the video above perfectly works and there is no redundant code in it. And the logic is optimized to work in minimum time.

  • @backtothetrace
    @backtothetrace 8 років тому +2

    This video is very good :) , a strong hug from Brazil...

  • @happyebb
    @happyebb 2 роки тому +1

    You break this down so well! Thank you! I will be checking more of your videos!

  • @neilbarker7577
    @neilbarker7577 10 років тому +1

    Superb. It's answered some questions I had regarding the backend website I want to build.

  • @moussmerouan
    @moussmerouan 4 роки тому +1

    Thank you for this very good presentation. Followed your steps and it all went smooth. Big thumbs up !

  • @rakhisingh7122
    @rakhisingh7122 6 років тому +1

    Thank u for this video ..........your way is very easy to understand ............

    • @rakhisingh7122
      @rakhisingh7122 6 років тому

      But the same time .......I want this with validation like email , phone number and name types(only character, only numbers n all) validation .........needed ........

  • @barajasfab
    @barajasfab 10 років тому

    Awesome video Satish. Clear and to the point.

  • @optical_ideas
    @optical_ideas 6 років тому

    thanks man, this helped a lot.
    hint for today (january 2018): output complains about: mysql_query is deprecated.
    I made some changes and it worked for me.
    the connection to db:
    $conn = new mysqli('localhost', 'root', 'your_pw', 'your_database');
    and the insert query:
    $conn->query("INSERT INTO table_name VALUES('whatever', 'values', 'you', 'got')");

  • @sivaanand2123
    @sivaanand2123 6 років тому +1

    your way is very easy to understand ............

  • @andamanel1763
    @andamanel1763 11 років тому

    never mind, I don't know what happened, but it's working correctly now. thanks

  • @kumaramresh7905
    @kumaramresh7905 5 років тому

    Nice tutorial ...post method of Ajax is really great

  • @dancanua7926
    @dancanua7926 9 років тому

    And I am also applied it in my modal! You are my life saver! hahaha cheers man! :D

  • @katsuneshinsengumi8727
    @katsuneshinsengumi8727 10 років тому

    You make the world easier to live,...

  • @salmankhan-ey7we
    @salmankhan-ey7we 4 роки тому

    Very helpful video, thanks man... 🙏

  • @Sora4277
    @Sora4277 11 років тому

    do you know how to insert data inside input forms in html on "website" not in code, and when inserted it remains there... : / i can't find it anywhere

  • @sandhyavishwakarma6909
    @sandhyavishwakarma6909 10 років тому +6

    sir Above video is very simple to understand.m in new php and will you please upload the video for simple carrier form including captcha and basic detail of the user.
    Thnx

    • @technotipDOTorg
      @technotipDOTorg  10 років тому +1

      Sandhya Vishwakarma I've this video tutorial published on my blog Technotip.com I've done it using Node.js and MongoDB. If you're still in the initial stages of learning php, then I would recommend you to shift to Node.js MongoDB

  • @dust_wrld280
    @dust_wrld280 5 років тому

    Panie Hindus, jesteś piękny i dziękuje ślicznie.

  • @matthewmcfarland3838
    @matthewmcfarland3838 6 років тому

    nice video. It took a little while to get going, but really nice demonstration. Thanks for sharing. Matt, California.

  • @foxywoxy0w068
    @foxywoxy0w068 3 роки тому

    Out of curiosity is there a way to get the data from the text fields onto a database but instead of manually inputting the text, the text is automatically entered there via a dropdown option?
    Like lets say I'm doing an escaperoom business and the customer can use a dropdown to choose what room they like to book, when they choose a room then text boxes will fill up displaying the info for that room.
    I've used an ajax to do the functionality of filling the text boxes with that specific information and for calculating total price and what not yet for some reason, my code will not accept the input and won't insert the data onto a table, it literally considers the text boxes as empty despite otherwise. How would I go about it so that the program checks if there is anything inside the text boxes and gather the info from there to output as data in the dbtable?

  • @joekennedy9920
    @joekennedy9920 8 років тому +1

    he does this really quickly, but you can see there isn’t much html - he’s just utilizing an html webpage that references a couple of PHP files and a js file. he writes to the db through what looks like he’s preventing sql injection methods but it’s all so compact. i think i’m gonna try to set something up like this. I’m be very curious to understand if there are security protocols that are missing from this. i mean it’s missing the SSL which would be necessary for our application, but i’m still not clear on how all of that ties together.

  • @FernandaEstradamarketing
    @FernandaEstradamarketing 7 років тому

    Thank you very much Satish. Excelent Tutorial

  • @shivashanker4488
    @shivashanker4488 6 років тому

    Your teaching skills are very good can you make videos on java platform.

  • @berradamido4206
    @berradamido4206 7 років тому

    thks you bro for this video is simple , undestandeble and I invite you to come in morroco

  • @sabidli1
    @sabidli1 11 років тому

    I like your video. keep on the good work

  • @jayakk_guitar
    @jayakk_guitar 11 років тому

    I am working on a small example where I use reservation system..Basically user picks a date and time and submits the form..The picked slot turns red onclick but the page refreshes after I submit the form and the slot goes back to green..I figured out that I need to use ajax calls to prevent a page refresh..Every time I log into the page the booked slots should be red.I am using jquery, php, mysql db..I am new to ajax and hoping to get some help from you.A video tutorial would be great. thanks :)

  • @palpraveen
    @palpraveen 11 років тому

    hi thanks ofr good video
    i need your help
    i have two dropdown and i want to change data of the second dropdown based on the values selected in first dropdown .
    (NOTE:- Values are retrived form the database and i want to use ajax and jquery )
    any suggestion ?

  • @Techelp2011
    @Techelp2011 11 років тому

    Quick question which program would you recommend
    Codelobster or Dreamweaver

  • @maxpowertothemax
    @maxpowertothemax 12 років тому

    Hey got it all figured out and is working great. One more thing though- Is there a way to have the result message from php as an .alert? Rather than a div. Thanks man- You rock! Going to watch some more of your videos :)

  • @magatjonathan1383
    @magatjonathan1383 7 років тому

    Can i use this to make a chat system? I'm trying to make a chat without using interval to refresh a specific part of the page..

  • @parasrastogi3174
    @parasrastogi3174 6 років тому

    i followed your guide except that you used external javascript file but i wrote the javascript code as internal javascript file between head tags... now i seem to get undefined index error on clicking the button
    [update the issue seems to be resolved .. just had to remove input from formname:input in js]
    also i am trying now to extract data from table in the same manner... the table gets extracted but is being shown on a new page. any suggestions ?

  • @Paul-px6sy
    @Paul-px6sy 10 років тому +1

    Very helpful, thanks Satish.

  • @ankitsuthar1698
    @ankitsuthar1698 9 років тому

    i am working on sending form data as a single JSON string in database and get it back that data in my html form.. so any idea...

  • @stephenung4736
    @stephenung4736 11 років тому

    Thanks for the tut, can you please show us how to multiple rows insert into database table? E.g. Row1 (id, name, age, job title, wage, date_joined) Row2 or Row3 with different data and ID is auto increment? With one submit button?

  • @ShivamSingh-wh9jj
    @ShivamSingh-wh9jj 5 років тому

    Bro which things you done in past we are doing as beginner

  • @dennisriparip
    @dennisriparip 10 років тому

    thanks for the tuts. I have question, in this code: $("#myForm :input").serializeArray() we are dealing with the input field but how about for textarea? because i'm trying to make a message form but the my page is not reading the script and it's forwarded to process.php. any solution for this?

  • @manualvarado2212
    @manualvarado2212 7 років тому

    Thank you so much! This helped me a lot to understand .get/.post and .ajax.

  • @decongh
    @decongh 11 років тому

    nice vedio, i will like to know how to validate the fields before inserting data, thanks

  • @batangnescafe
    @batangnescafe 12 років тому

    uhmm.. i just want to ask something
    what are post folder and script folder for? im all new to this....

  • @maxpowertothemax
    @maxpowertothemax 12 років тому

    Is there a way in jquery to put a condition to 'do nothing' if there is nothing entered in the feilds? or would we have to make that a php condition?

  • @naveens5852
    @naveens5852 4 роки тому

    which server you are using ? tomact or apache

  • @patelsuresh22
    @patelsuresh22 11 років тому

    superb tutorial satis. keep it up. please upload it with hindi langauge also, because i don't well know english. Thanks again.

  • @maxpowertothemax
    @maxpowertothemax 12 років тому

    This was a great video. You explained everything great. Only problem is my jquery dosent seem to call the .js page. PHP and form inputs work though. It just keeps loading the php file from form action. Been dealing with this all week. Its completely frustrating! Thanks for the tut though. It does help me out alot-

  • @hivs70
    @hivs70 11 років тому

    can I use this with my bootstrap modal?
    coz I use bootstrap modal with my registration form
    pls reply thanks great tut very informative tutorial though!

  • @jayakk_guitar
    @jayakk_guitar 11 років тому

    Instead of name and age I want to send html table td elements using ajax call...I hope you get my point..Thanks for reply

  • @coxixx
    @coxixx 9 років тому

    Hi it was awesome! just would you tell me how to add preloader to your code .

  • @raiyashasveesrivastav
    @raiyashasveesrivastav 7 років тому

    Hi Satish Sir,
    I have created a dynamic table by using JQuery and HTML now I want to fetch the data from each row of dynamic table but the dynamic table is created all row with the same name so How to fetch the value in php file?

  • @qwebbuilder
    @qwebbuilder 4 роки тому

    Hello, I have been going through all your tutorials it has been wonderful.
    I need your help to execute this php function.
    Haven gathered some knowledge I wanted to combine all in place to test my abilities.
    I have a table investment and a user table in my database.
    When a user place and investment I need to filter it by looping or something else to auto credit it's wallet per day based on the 1.5% in php.
    How will I do it?
    I have tried all ur looping course none met my needs.
    How do I;
    1. Do the daily auto wallet increment
    2. Is it cron job
    3. How to I go about it
    Just a hint

    • @technotipDOTorg
      @technotipDOTorg  4 роки тому

      It's a cron job. Execute a script to credit wallet every 24hrs. You need to set a cron job. 👍

    • @qwebbuilder
      @qwebbuilder 4 роки тому

      @@technotipDOTorg can u help me with the php script hint?

  • @bachirelamine1220
    @bachirelamine1220 8 років тому

    thanks your brother from Algeria.......

  • @JACNNN80
    @JACNNN80 11 років тому

    Thanks for this tutorial, When we complete entering data can you tell me how can make Page Query for Data ? I mean how can make page search .
    Thanks

  • @jordistoop3682
    @jordistoop3682 9 років тому

    I don't unstand how to *.php file is started, doesn't your form require a action when pressing submit? How does your *.php script know when to start?

  • @ananthsview8034
    @ananthsview8034 11 років тому

    If the PHP returns json encoded data how we can get data ...? can u give me a example ..?

  • @damirzivkusic9236
    @damirzivkusic9236 11 років тому +2

    man you'r my legend :)

  • @overbillionviews
    @overbillionviews 8 років тому +1

    Хорошее видео! Индус всё показал и разжевал xD

  • @technotipDOTorg
    @technotipDOTorg  11 років тому +1

    It's a JavaScript library you can download from jQuery.com website.
    Please follow the tutorials in its order and you'll not be confused.
    For the list of tutorial order, please visit the link present in the description section of above video or visit our site and browse through jQuery category.
    Hope that helps ..

  • @maheshtharu705
    @maheshtharu705 9 років тому

    It's all amazing tutorial I like very much thankss alot.

  • @Jkevin84
    @Jkevin84 9 років тому

    Can I use this method to insert data into tables that has already some data populated in it?

    • @nilsinchina
      @nilsinchina 8 років тому

      yes if you do it properly, i.e. follow your table's structure.

  • @Gapbrick
    @Gapbrick 12 років тому

    Make sure, that jQuery is installed correctly. Else, read the code again and tell yourself, what every function does. If there's something wrong, you'll get that with this method (that often helps me)

  • @andamanel1763
    @andamanel1763 11 років тому

    I am not getting the values of the text boxes inserted into the user table. I am getting the names of the variables. For example: instead of John, 30 inserted into the DB, I am getting $name, 0 inserted into the DB user table. How do I get the values, not the variables? My code in the userInfo.php is exactly like yours and I am getting the "successfully inserted" message. Thanks!

  • @sabrinao.1251
    @sabrinao.1251 8 років тому

    You rock Satish !

  • @C4ll1bur
    @C4ll1bur 5 років тому +1

    This was very helpful! Thanks a lot!

  • @djablazman3986
    @djablazman3986 4 роки тому

    Thank you for this video, now how to uplad text and an or more ?? Using this code

  • @willbarrios2737
    @willbarrios2737 5 років тому

    hello sir! my page still reload every time i clck the save button. i followed everything on your vid except instead of html file for the fields, it is a php file. will it matter?

  • @satlibwanzai111
    @satlibwanzai111 7 років тому +1

    Thank you for your video. Please explain function(info). Why did you choose the name 'info'? Can we use any other name, or did you choose 'info' because it is a system global variable? Thanks:)

  • @VKTVCHANNEL
    @VKTVCHANNEL 11 років тому

    Can I download these coded files? if yes, where?

  • @YasirMalik24
    @YasirMalik24 8 років тому +2

    i am having problem that when i submit first time its working fine but 2nd time its not submit data into database

  • @barez0
    @barez0 11 років тому

    really great tutorial thanx,but i didn't find the next tutorial display inserted data ,pleas post to me it links.. :)

  • @lofiscide
    @lofiscide 3 роки тому

    I liked your channel
    Sir where you are from?

  •  10 років тому

    great tut i would like to know how to use php vars like a logged in username session instead of a user input and also a php var for if a user is vieing a friends profile page so i would like to know how to send 2 vars to a parser without refresh it is for a poke application i am making can you do a tut on this please?

  • @kentuituvy2892
    @kentuituvy2892 8 років тому

    i'm adding a new data into my database and it will show in my website but before my data show in my website i need to refresh it..what is the problem?? plz help..

  •  8 років тому

    Thank you for useful knowledge

  • @milos1583
    @milos1583 8 років тому

    How about addressing mysql injection??

  • @jamesmccann8127
    @jamesmccann8127 10 років тому

    Brilliant, just what I needed!

  • @ImTcad
    @ImTcad 11 років тому

    I have seen people use something similar to this.
    $.ajax({
    url: "test.html",
    context: document.body
    }).done(function() {
    $( this ).addClass( "done" );
    });
    The tutorial does what I want to do, yes. Thank you. But is it the best way to do it?

  • @Leilektsoglou
    @Leilektsoglou 8 років тому

    db.php file is not completed (where we use the variables $conn and $db ????)

  • @HafizurRahmanhafiz007
    @HafizurRahmanhafiz007 9 років тому

    Also I want to send file name (image name with extension) using serializeArray() to database.. I have tried it but It is not working... please help...

  • @mhiavalencia1200
    @mhiavalencia1200 9 років тому

    Good tutorial! I hope this will work to my project! :)

  • @sharmasudhirdutt
    @sharmasudhirdutt 10 років тому

    this is excellent video

  • @penumak
    @penumak 11 років тому

    in sourceforge education section on page number five you can get it please help me

  • @penumak
    @penumak 11 років тому

    hi dude you seems to be with lot of patience and helpful iam a school teacher there is software called Dredge school administrations system you can find it in sourceforg
    please help how to make it work i tried intslling wamp and all but didnt get it.
    iam a novice lol

  • @sayedmaysoor4355
    @sayedmaysoor4355 4 роки тому

    What is that PHPMyadmin page? is it your Database like MySQL?

  • @AsepRidwan
    @AsepRidwan 10 років тому +1

    What a nice video, man.

  • @LlJeom
    @LlJeom 11 років тому

    thanks for the tutorial. but i have a problem when using the method. i can't echo out the values typed in the text field. can you help me?

  • @sidchamp77
    @sidchamp77 8 років тому

    bro please help
    when i put a code (like :
    $_SESSION['is_logged_in']=true;
    $_SESSION['user_email']=$email;
    header('location:2signuphome.html');
    )
    of next page link instead of " SUCCESSFULLY INSERTED " ,it also open in the div
    can you help me
    any code condition suggestion???
    please help

  • @tech_qwerty
    @tech_qwerty 5 років тому +1

    Thank you Satish

  • @randycramer7273
    @randycramer7273 9 років тому

    Could you please remake this tutorial using mysqli or PDO? You are easy to follow along with and do a good job, but mysql is deprecated.

  • @RulliR
    @RulliR 4 роки тому

    halo nice tutor but why I can not getting index of my value after I put return false line, and when I delete those line i will get my value but my page direct to my php file

  • @Techelp2011
    @Techelp2011 11 років тому

    Thank you so much this video helped me so much thank you I subbed and liked xD

  • @alexisgacasan6963
    @alexisgacasan6963 6 років тому +1

    what does this line do? "$("myForm").submit( function() {
    return false;
    });

    • @technotipDOTorg
      @technotipDOTorg  6 років тому

      It avoids redirection of the page upon pressing/clicking submit button.

    • @alexisgacasan6963
      @alexisgacasan6963 6 років тому

      Satish B ,hi, i used it on my project im making atm,but my form still refreshes after clicking the submit button

    • @alexisgacasan6963
      @alexisgacasan6963 6 років тому

      Satish B update, it already works now, but my next problem is it wont save my data into my database, I'm just new in ajax hehe

    • @wayveyx
      @wayveyx 5 років тому

      @@alexisgacasan6963 same, mine just keeps saying "failed to add user"

    • @computertutorial3892
      @computertutorial3892 4 роки тому

      @@technotipDOTorg My page keeps directing to php page. please help

  • @tarakotha5244
    @tarakotha5244 5 років тому

    hi you haven't mentioned why and how you included jquery link

  • @NeilBarduson
    @NeilBarduson 11 років тому

    how do you get the files to work on port 8081?

    • @technotipDOTorg
      @technotipDOTorg  11 років тому

      You need to change the settings present in the php.ini file
      Let me know, if you couldn't do it. I'll post step-by-step instructions once I get to my PC.

    • @NeilBarduson
      @NeilBarduson 11 років тому

      ***** If you could point me in the right direction that would be great. I am a bit of a newbie to programming. Thanks much and the tuts are great!

    • @calvinschools
      @calvinschools 11 років тому

      Neil Barduson
      You dont have to specify the port
      Look up how to connect to db with PDO. Im assuming that 8081 is your localhost
      simple connection example:
      $username = "root";
      $pass ="root"; //no pswd on localhost
      $db = new PDO("mysql:localhost;dbname=TheDByouWantToUse",$username, $pass);

  • @anthonykdramanu9158
    @anthonykdramanu9158 2 роки тому

    My php file is opening wihtin the same window as the html file but it does nto return to the HTML code

  • @lucaslucero18
    @lucaslucero18 11 років тому

    When I press submit button, the form insert the values into my datebase, but my page goes to the php file and it doesn't stay in the index file without refreshing the full page, what's going wrong?

  • @ashnashilmy1323
    @ashnashilmy1323 5 років тому +1

    It works❤

  • @Jzarecta
    @Jzarecta 9 років тому

    I have a question, regarding inserting info, I was pretty confused since there was no relationship with the filename Userinfo.php at 7:56 so not sure what exactly stand for. I guess I should read the method documentation used there.

  • @ashnashilmy1323
    @ashnashilmy1323 5 років тому +1

    Put button to ,
    type=submit 👌
    Another has default submit
    .

  • @sahilvig22
    @sahilvig22 6 років тому +3

    Thank you so much brother!

    • @sahilvig22
      @sahilvig22 6 років тому

      tictac Guys yes man. Perfectly working.

    • @sahilvig22
      @sahilvig22 6 років тому

      tictac Guys all i can say is to try again. Since it actually woked for me the exact same way. It's difficult to find errors so just try again with a new file

  • @viengvilay100
    @viengvilay100 11 років тому

    Good, I understood when mute speakers,