Это видео недоступно.
Сожалеем об этом.

PHP Tutorials: jQuery: Get data from MySQL Database without refreshing

Поделиться
HTML-код
  • Опубликовано: 14 авг 2024
  • Want more? Explore the library at www.codecourse...
    Official site
    www.codecourse...
    Twitter
    / teamcodecourse

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

  • @bdurao
    @bdurao 13 лет назад

    After spending long hours messing up with ajax forms without any success, i found your tutorial and finally solved my code problems. Thanks a lot for taking your time to upload this, Alex. Cheers.

  • @tweetymr
    @tweetymr 11 лет назад

    Never thought that the communication between JQuery and MySQL is THAT easy... Thanks for the example! Great tutorial.

  • @otdrbiker
    @otdrbiker 13 лет назад

    This was probably the best use of php mysql and jquery to return db objects and the .post method I've found in much searching. This is excellent.

  • @JohnShirey
    @JohnShirey 10 лет назад

    I have never seen incremental code dev/test done so well. I know this is simple example, but his function checks are marvelous.

  • @sdavidnowlin
    @sdavidnowlin 13 лет назад

    Excellent tutorial. I wish more of these step-by-step simple walkthroughs were available. Thanks.

  • @mattonm
    @mattonm 11 лет назад

    Thanks for the tutorial Alex. This is all new to me. I have a form with a table containing several textboxes and I want to populate them when I fetch the record. Watching your video gave me the idea of filling in the cells of the table using div, instead of trying to put the record data in the textbox. I'm going to try that. Thanks again!

  • @anath47
    @anath47 14 лет назад

    Thank you for making these videos. I feel like I'm a better programmer every time you post a post.

  • @HincorXXX
    @HincorXXX 13 лет назад

    Thank you so much for your tutorial... it helps not only me but almost all beginners in PHP... please keep posting your tutorials...

  • @sanetalking
    @sanetalking 11 лет назад

    First time I have every seen the Java Concept Like this. I could get to like this. Thank you soooooo!! much

  • @sharyaroraaaa
    @sharyaroraaaa 13 лет назад

    you are the best dear.......your tutorials are best on the net......i always found useful and everytime the code runs perfectly......thanks a tonn......

  • @ufowam
    @ufowam 12 лет назад

    I personally much prefer his pace rather than someone that will go slowly, explain everything everytime and bore the hell out of me :p
    depends on people I guess

  • @diggidan
    @diggidan 13 лет назад

    Finally a simple and good tutorial of the basics! Thank you so much!

  • @joannjmaliyil
    @joannjmaliyil 14 лет назад

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

  • @MaxBiragnet
    @MaxBiragnet 13 лет назад

    Thanks a lot!! just an advice.. It was not a problem for me, but some people may have problems with the not-so-much-difference names between variables.. as you named "database" the database.. or "name" so much times.. Anyway, I want to thank you because I found this tutorial really helpful! I'm following you!

  • @mikeyo1234
    @mikeyo1234 12 лет назад

    Thanks for this excellent tutorial. You are a very talented teacher and presenter. Respect! I'm yet to try it out but very excited to get this integrated in to my website... posting forms is so 18th century ;-)

  • @gerryabbott
    @gerryabbott 12 лет назад

    Excellent tutorial. Love your how you go through the checking process as you code. Saves so much time in the long run. Learnt a lot. I'm a subscriber now. !!

  • @baddanmorgan
    @baddanmorgan 11 лет назад

    Thankyou so much for this vid Alex! I've been stuck on this problem for 2 days and your method works for me now, so I owe you one! :D

  • @empirejb
    @empirejb 12 лет назад

    BRILLIANT! Tutorial was one of the best Ive found online, very well explained and easy too follow. Many thanks for your work.

  • @ashoksen2003
    @ashoksen2003 10 лет назад

    I like the way you discuss this tutorial. It is very informative. This is exactly what I am looking for. Thank you! Keep it up! And I expect something more complex.

  • @imjc
    @imjc 12 лет назад

    Simple, clear and useful. Thanks, man. It helped a lot!!

  • @Tubusy
    @Tubusy 12 лет назад

    Beautifully explained and demonstrated. Thanks.

  • @AkhileshTiwariit
    @AkhileshTiwariit 14 лет назад

    Respected Alex sir, You are great, I've been learning a lot from,
    one request to you that post a video on online exam and save marks in a database of ten questions only plzzzzzzzzz do me this favor.

  • @MrPampas2
    @MrPampas2 13 лет назад

    This is a great tutorial, and I'm certainly going to subscribe to your channel. By the way I had to rewrite your function (with the combined help of comments on here.
    I'm running Firefox Beta 4.0 and neither of the individual comments worked; however when I combined them, I got them to work; so in case anyone else is looking for the solution to the firefox problem; here's the full function re-written:
    $.post('data.php', { name: $('form[name=form] input[name=name]').val() },
    Good luck

  • @capechronicler
    @capechronicler 12 лет назад

    This code works great as a stand alone, but I had problems with it when it is incorporated into a compliant HTML file with a DOCTYPE tag (remove the doctype and it works fine).
    The problem is with a section of the script
    $.post('check.php', { username: form.username.value },
    if you replace it with
    $.post('check.php', { username: $(this).val() },
    it works fine with a DOCTYPE tag at the beginning of the file.
    This makes your files compliant!

  • @Viperjts10
    @Viperjts10 14 лет назад

    @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

  • @americancitizen748
    @americancitizen748 8 лет назад

    If you are using the newer msqli_query then try this:
    $row=mysqli_fetch_array($age,MYSQLI_ASSOC);
    $age=$row["age"];
    echo "$name's age is $age";

  • @Richard003217
    @Richard003217 13 лет назад

    A very nice tutorial. I wish, though (as I know you wish also) that you would have been more careful in using "name", and "get" for the confusion of usual syntax with "post", "get", "form", "name" which makes it more difficult to understand. Figuring it out, though, can be a good way to "get it". Thanks!

  • @IranianButterfly
    @IranianButterfly 12 лет назад

    Straightforward and simple thanks.

  • @Remi1115
    @Remi1115 14 лет назад

    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.

  • @Klootviool17
    @Klootviool17 10 лет назад +1

    Maybe you can help me, i am trying to get multiple records from the database, and want to show them on different places on the site. Can you guide me in the right direction?

  • @PeterWrightNZ
    @PeterWrightNZ 12 лет назад

    Outstanding Tutorial!
    Keep up the great work. You are a real pro!

  • @shaya_sonnenberg
    @shaya_sonnenberg 14 лет назад

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

  • @JamesAutoDude
    @JamesAutoDude 11 лет назад

    Also, you could just include JQuery using the actual URL, instead of copying all the text into a file (taking up space). But it's really just personal preference.

  • @mwjmk
    @mwjmk 13 лет назад

    Which tutorial do we watch that shows how not to expose any sql to the browser? Ex. adding another layer between the client and db?

  • @ajakubo11
    @ajakubo11 12 лет назад

    Sorry, my bad. The line is ok, don't use the one from my previous post. I've had some problems with my web browser cache. Everything works fine ;). Thanks a lot for this tutorial.

  •  14 лет назад

    You're Great Alex! Your's tutors are great too! Very Great! Thanks a LOT!

  • @flowewritharoma
    @flowewritharoma 13 лет назад

    Thanks for Pharmaceutical video. It is for me to useful.

  • @clickatron
    @clickatron 13 лет назад

    great work. simple and to the point.

  • @eljochavz
    @eljochavz 12 лет назад

    thank you for this lesson...do you know how to insert the plugins in the database?

  • @ruthwijma
    @ruthwijma 13 лет назад

    Great video, had some trouble though about passing through the variables to the php doc, it only seemed to work when the form name was form. But again nice video :)

  • @authentikitsolutions
    @authentikitsolutions 13 лет назад

    FINALLY! Some has helped me to understand this thing. Thanks man!

  • @Samiakram1
    @Samiakram1 12 лет назад

    Excellent work, excellent way to guide... Thanks a lot

  • @OusmaneNdiaye
    @OusmaneNdiaye 12 лет назад

    @psmooth777 I suggest you to change input type="submit" to input type="button" in your form

  • @SuperPopkung
    @SuperPopkung 12 лет назад

    thank you for better vdo for jQuery technique

  • @newybocktor
    @newybocktor 12 лет назад

    I really got benefit from your tutorial, but I need to know how to control the out put, if I have more than output variable affect more than one div, how could I manage this

  • @messiefee
    @messiefee 14 лет назад

    Men you are extraordinary tnx for this kine of tutorial, you help so mouch...

  • @puaflatmates
    @puaflatmates 13 лет назад

    @rohitbellary
    add document to:
    form.name.value
    so it looks like this:
    document.form.name.value

  • @MrStenW
    @MrStenW 11 лет назад

    That is quite complicated. That is a lot of work.

  • @HelloQro
    @HelloQro 12 лет назад

    i think you can return an array from data.php and then do a foreach in the jquery that show every result from the array.

  • @ajakubo11
    @ajakubo11 12 лет назад

    That was great! just needed to make one adjustment:
    instead of:
    function(output)
    {
    ${#age}.html(output).show();
    }
    I needed to do:
    $(document).ready(function(output){
    $("#age").html(output);
    })
    and it worked ;).

  • @cherylwigand7242
    @cherylwigand7242 11 лет назад

    I too got hosting account for 1 cent thank you so much
    Harriett Hollingworth

  • @XinWongDigital
    @XinWongDigital 13 лет назад

    fantastic video,i've watched a few of yours, they are really good. maybe if the level becomes slightly higher then the learner will have sth more to challenge and learn more. again thanks for the effor.

  • @yuchunc
    @yuchunc 13 лет назад

    OH NICE~~!!!.... Exactly what I am looking for!! You are a life saver!! twice!!

  • @89sarsar
    @89sarsar 12 лет назад

    thank you !!! there was a bug in my code ,
    it didn't work cuz i named the form "name" instead of "form". so ppl check yours carefully don't give up

  • @montelomanis
    @montelomanis 13 лет назад

    good job Alex! Can you tell me how to make it working when I m pressing the Enter key ? Because it is only working with the mouse-click. Thanks!

  • @Bixyo74
    @Bixyo74 12 лет назад

    Great tutorial. What about if I would need to keep more then one value and store them into a fieldset? Examp:
    input type='hidden' id='id' value='id corresponding with alex's name'
    input type='hidden' id='age' value='age corresponding with alex's age'
    and so on... Thanks in advance and congratulations again for the helpful tutorial :-)

  • @vidz022
    @vidz022 13 лет назад

    i followed you, however, it is advisable to use different value names for each tag attributes which is not the same as the HTML TAG itself. Like for example FORM TAG with NAME attribute should not be named "Form" instead use "form1". So that whenever you wish to call it in jQuery function, it could easily be recognized that the one you typed in the function calls the attribute name value, not the TAG. ex : varFromTextbox: form1.name1.value in jQuery script. Still, your lesson is helpful.

  • @flightkid150
    @flightkid150 14 лет назад

    thanks i can use this for so many things

  • @scion3713
    @scion3713 13 лет назад

    Thanks for this video man. Keep up the good work.

  • @JonLeeSmith
    @JonLeeSmith 13 лет назад

    Nice tut, but if you post the form with enter it seems to bugger it up?

  • @vazqjose
    @vazqjose 13 лет назад

    @aalamnaryab Use a comma, example: name: document.form.name.value, email:document.form.email.value, etc....

  • @reaper1857
    @reaper1857 11 лет назад

    awesome, this method can be used for many stuff

  • @xSPESHERx
    @xSPESHERx 10 лет назад

    Holly fu**!!
    Thx you very much,bro!!!!
    Now, i can understanding this ajax request in jquery $.post....!!!!!))))
    THX!!!!!
    Hello from Ukraine

  • @gaspareciviero628
    @gaspareciviero628 12 лет назад

    Fantastic tutorial... Thank you very much!!!

  • @MagicRevealer09
    @MagicRevealer09 14 лет назад

    Yay! Great tut. I'm a noob at PHP, you've helped alot though.

  • @pratikbhavsar6098
    @pratikbhavsar6098 8 лет назад

    hey,the code works for me but the div which is getting displayed on button click is disappearing quickly.So what should I do...?

  • @hasan4it
    @hasan4it 13 лет назад

    I want to search different thing from the database at the same time.
    search with name and email for example.
    so how we can pass the other variable value using the same code

  • @Lundburgerr
    @Lundburgerr 13 лет назад

    This works great so long you're not pressing enter while in text field, 'cus that will make the form submit php-wise, use this code to disable it:
    $("form").submit(function(event){
    event.preventDefault();
    return false;
    });

  • @Viperjts10
    @Viperjts10 14 лет назад

    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.

  • @MeMyselfAndDie
    @MeMyselfAndDie 12 лет назад

    wonderful lesson. I finally understood some fine details. Thank you for this fine tutorial :)
    Could you please do a tut on the php aspect of AJAX functinality (including tips for better coding?)

  • @dbzssjgohan
    @dbzssjgohan 12 лет назад

    Thank you very much Alex, great tutorial as always :)

  • @ahmedihmeid
    @ahmedihmeid 13 лет назад

    yup...it is very helpful..thanks Alex

  • @schumibr1
    @schumibr1 13 лет назад

    THESE VIDEOS PWN EVERYTHING ON THE WEB
    GJ PHPACADEMY

  • @Itaysid
    @Itaysid 13 лет назад

    I had some problems with this in Firefox 4, apparently it tells me that the name of the form is not defined, tried to give the form an ID but still no good. tool me a while till I switched to Chrome and saw that it worked

  • @G4nt3ng22
    @G4nt3ng22 9 лет назад

    i have question
    how to show the image from database ?
    i'll try to show it but i have problem with tag that show in result
    when i type the data i want search then it showed like this not show the image

  • @ChrisPBacon2010
    @ChrisPBacon2010 12 лет назад

    I am messing around with some code and trying to make a messenger, I have all working only I need to know what the best way to loop the function to update the content instead of having to click a button every time?

  • @notta3d
    @notta3d 14 лет назад

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

  • @Remi1115
    @Remi1115 14 лет назад

    Nice tutorial, thank you for sharing it.

  • @sSoloW
    @sSoloW 14 лет назад

    but I couldn't get it to work...my HTML is created using echo"HTML"; should the javascript in the HEAD tags work the same if it is being echoed out? I dont get any errors on page, simply the onClick event seems to do nothing.

  • @ezloves
    @ezloves 11 лет назад

    thanks. This was very helpful for me.

  • @cruzbaggio
    @cruzbaggio 13 лет назад

    Hello, Great Tutorial!
    I was wondering if you know to do this:
    I have a form with some text inputs, but I also have a input type’file'
    which I’m trying to pass to data.php along with the text inputs so I can process everything there. I see that you use $.post to pass a text input, but is there a way to pass an input ‘file’and the get its values (name, size…) to validate it in data.php
    Any help will be appreciated, Thanks so much!

  • @IsaacRosarioDurantecnicomp
    @IsaacRosarioDurantecnicomp 9 лет назад

    How can i update the tables automatic without refreshing the page, what i want to is: Is someone insert a new record in the database in my office from another web browser i want to the new info in my browser but without refresh the page. How can i apply this tutorial to my project?

  • @riotact316
    @riotact316 14 лет назад

    por fin aprendí algo de jquery gracias a tu video, saludos

  • @slytherin9090
    @slytherin9090 12 лет назад

    @psmooth777 Try including an onKeydown Event in the submit button...and placing the get(); inside..

  • @hamzarahman7763
    @hamzarahman7763 8 лет назад

    if i want to use this $('#text').html(output).show(); --> data for further use what step should i follow ..like
    var text =$('#text').html(output).show(); thanks

  • @PictureFilmsInMotion
    @PictureFilmsInMotion 9 лет назад

    I have a question ... how can i display the results in multiple divs Like i want some of the results to show in one div1 and other results in other div2. Thanks in advance

  • @americancitizen748
    @americancitizen748 8 лет назад

    Very good. This was helpful to me.

  • @YZpilot736
    @YZpilot736 12 лет назад

    is form.name.value better in any way than using document.getElementById or is it just preference?

  • @vazqjose
    @vazqjose 13 лет назад

    @aalamnaryab i added an email field and textbox to post too. Now that you can do that you can get back anything you want.

  • @Sumuwilla
    @Sumuwilla 13 лет назад

    Hi , how can I do the same thing, but instead of clicking on the button
    I click on an image to get some text from my Database according to what I want ??

  • @AshleyWharton
    @AshleyWharton 12 лет назад

    Excellent.... Thanks so much!

  • @Rob0Anybody
    @Rob0Anybody 12 лет назад

    Absolutely great, thanks so much!

  • @mrorange159
    @mrorange159 12 лет назад

    Great video, this has helped me a lot so far, you're a champion Alex. I have a question, if my php generates its own html form elements can this existing javascript code read those elements dynamically as the div is updated?

  • @Viperjts10
    @Viperjts10 14 лет назад

    @CrazyDancingBear Thanks for the info. It looks like after I get a good understanding with php, I'll have to move onto ajax. I REALLY have seen some incredible things done with ajax, and if I can figure out how to use that language, it would show some good knowledge.

  • @ariekendari
    @ariekendari 11 лет назад

    there is some problem, what if the user does not click 'get' but direct hit enter
    the results will not appear..

  • @BABURAOIU
    @BABURAOIU 14 лет назад

    @machine1112 yes with a few modifications, you can.

  • @sifah31
    @sifah31 11 лет назад

    Great tutorial, Thank you.

  • @MohammadAkhlaghi7
    @MohammadAkhlaghi7 13 лет назад

    Great Tutorial ... However the code doesn't run on Firefox 4 !?? Does anyone know how to fix that !??

  • @tirumalraot
    @tirumalraot 12 лет назад

    Great tuts!!!! keep posting!!! :)

  • @prashjad
    @prashjad 12 лет назад

    Hi Alex
    what if I want to add one more variable in $.post('login.php',{name:form1.email.value},
    I am trying to make login.