PHP Tutorial: Return data from a MySQL Database without refreshing (using jQuery)

Outputs the age of a specified name typed in a form, without a page refresh. It’s easy, using jQuery! Great for beginners to AJAX style methods. FORUM phpacademy.org TWITTER twitter.com BLOG blog.phpacademy.org

Both comments and pings are currently closed.

35 Responses to “PHP Tutorial: Return data from a MySQL Database without refreshing (using jQuery)”

  1. machine1112 says:

    @BABURAOIU can you please give me a link to the tutorial or article about that THANKS !

  2. BABURAOIU says:

    @machine1112 yes with a few modifications, you can.

  3. Remi1115 says:

    I can’t get this to work and i’m using Firefox and i checked the code more then 5 times.

  4. shayat123456 says:

    Thanckyou I was whating for a lung time for this tutorial!!!!!

  5. Remi1115 says:

    Sorry for my stupid comment under here, i understand it, and it’s really handy, i didn’t know that you could do that.

    Thank you for sharing this.

  6. Remi1115 says:

    So the browser can connect to the servers without refreshing a page?

  7. Viperjts10 says:

    @phpacademy Ok yea, I’m still learning myself about the whole php idea, and I just wanted to make sure I wasn’t too incorrect in the idea that it could be done a different way. In a way though, this vid helped me out because it gave me an exercise. Since you showed the end result at the beginning, I immediately began to see if I could do this without jquery and with what I could remember in my head, with connecting to databases and all, and I managed to do it. So I do appreciate the videos, thx

  8. machine1112 says:

    can i send data to my db this way ?

  9. phpacademy says:

    @Viperjts10 Like you said, it’s just an example of what jQuery can do. It’s just a demonstration of how to get data without having to refresh the page.

  10. cocoloos says:

    awesome ! now i’m begining to understand jQuery. we want more jQ when you’ll have time to do other video tutorials

  11. hayk7 says:

    thank you very much…. keep going make some noew tutorials of sending messages beetween users with ajax in site…

  12. Viperjts10 says:

    I’m just curious to know why jquery is needed for this. I’m assuming this is just supposed to be an easy example/demonstration as to what jquery is capable of doing, but you could toss that php which you had on data.php onto the first page (index.php) and use a simple if($_POST['submit']) to decide whether or not to display some text.

  13. TheTyrhus says:

    Hi Alex,
    Great tut thanks :-)

  14. adi25l says:

    great tutorial!
    I would be happy if you will decide to teach jQuery along side php…

  15. willzurmacht says:

    Thank you sir.

  16. ForTheTM says:

    You are awesome!!!

  17. jaisonmathewbaby says:

    Heard a lot abt Jquery. Thanks for including that in a tutorial.

  18. eclassentertainment says:

    thx Alex ! this is def a must have and a must know tut!!!

  19. n1tr0b says:

    So Sweet!

  20. phpacademy says:

    @santosbl01 I realised that after. Thanks for letting me know anyway.

  21. flightkid150 says:

    thanks i can use this for so many things

  22. santosbl01 says:

    When using a input-button instead of a real submit-button you lose the option to just press Enter to send the data. You can just as easy use a real submit-button without an onClick, and write onSubmit=”get(); return false;” in your form-tag instead.

  23. notta3d says:

    Nice. I’ve been waiting for this. Thanks!!

  24. HabZbaH says:

    HOLY SHIT I NEEDED THIS! Thank you so much

  25. nicktought5 says:

    nice tutorial!! thanks alex for sharing this with us! you always do a great job! ;)

  26. [...] Read more here: PHP Tutorial: Return data from a MySQL Database without refreshing … [...]

  27. [...] This post was mentioned on Twitter by freephptutorial, Larry King. Larry King said: PHP Tutorial: Return data from a MySQL Database without refreshing … http://bit.ly/dliliZ #jQuery [...]

  28. [...] artykuł na: PHP Tutorial: Return data from a MySQL Database without refreshing … a-page-refresh-, a-specified-name, ajax, forum, outputs-the-age, page-refresh-, specified-name, [...]

  29. [...] PHP Tutorial: Return data from a MySQL Database without refreshing … [...]

  30. [...] Go here to read the rest: PHP Tutorial: Return data from a MySQL Database without refreshing … [...]

  31. [...] PHP Tutorial: Return data from a MySQL Database without refreshing (using jQuery) | PHP Blog [...]