PHP Tutorials: jQuery: Get Data from MySQL Database without Refreshing

  Рет қаралды 269,503

Codecourse

Codecourse

Күн бұрын

Пікірлер: 222
@benmontoya428
@benmontoya428 9 жыл бұрын
I've been watching your tutorials along with TheNewBoston's tutorials and I have to say you two are possibly the greatest teachers ever when it comes to programming. You guys are very descriptive and organized, and it's really easy to keep along and understand everything. Thank you.
@karlpokus
@karlpokus 11 жыл бұрын
I love that you start off your tuts with the result. Should really be a best practise. Kudos!
@SuperVegan1
@SuperVegan1 10 жыл бұрын
Very nice, no excess information and I understood it even though I've never done any php, thank you.
@codecourse
@codecourse 10 жыл бұрын
That's great to hear! Glad you found it helpful.
@proxdegracia6788
@proxdegracia6788 9 жыл бұрын
***** sir gud am, how to make the display in table form
@LeviMr77
@LeviMr77 9 жыл бұрын
Holy mother of god! Just what I needed, I built the interbase version instantly as I was watching your video. Respect +++
@Patmanduu
@Patmanduu 11 жыл бұрын
Wow. Thanks for that. I WAS using single quotes in the query. Haven't touched the grave accents button in years (since high school French class).
@thesickbeat
@thesickbeat 12 жыл бұрын
Thank you for this. I'm not interested in ajax but this definitely helped me out ALOT with my school assignments.
@violinov
@violinov 11 жыл бұрын
Your tutorials are f*****g excellent man. Good job!
10 жыл бұрын
Thank you! I had a problem, when i watched half of this tutorial i got the explanation!
@obsdark
@obsdark 10 жыл бұрын
Excelent work But i have a question.., you see, i'm trying to do this with a PDO syntax, but in PDO you can't select the specific table of a db, so, how can i do it to AJAX search in the right table the information what i need? Thanks in advance
@VigilianceAurelious
@VigilianceAurelious 12 жыл бұрын
This is what I've really need on my thesis project! Thanks Alex! :D
@hieronymus1981
@hieronymus1981 11 жыл бұрын
I always end up with a youtube video of this dude. I wonder.... Again cool stuff mate. !
@22mawdizzle22
@22mawdizzle22 12 жыл бұрын
Alex, how would you fire the same type of AJAX to PHP reaction using Google Maps API V3? There is a listener event on a map marker that I can set to do something when the user clicks. So I want to do the exact same thing you did, but from the map. i.e. the user clicks the marker and my javascript sends my PHP the id of the marker clicked.
@a55a51n2
@a55a51n2 11 жыл бұрын
followed your tutorial and it works great. how do i make it so that if i select a value from a select element it echoes the value in a text element of a form.?
@lestevesl
@lestevesl Жыл бұрын
Still useful after 11 years.
@amitasthana
@amitasthana 11 жыл бұрын
Hey alex, i want to do the same thing, but i dont want to use the submit type button, i want it should give result as soon as i type in the box, maybe on page or a alert box, i know it can be done...., do you have some tutorial to explain this?
@santunu23
@santunu23 9 жыл бұрын
Excellent tutorial neat and clean.I need a suggestion can i grab the fetch data into a input tag?
@cvilee
@cvilee 12 жыл бұрын
Hey alex, nice tut but how would you get back multiple records and store them into table perhaps? Yea i know theres a lot of completed grids waiting just to be implemented, but i just wondering is there any way for us to make from scrach complete CRUD grid with jquery and ajax. Thanks alot for everything you've done so far
@TheMrChugger
@TheMrChugger 12 жыл бұрын
Chorley... What a beautiful part of the world!
@gabrieletim4418
@gabrieletim4418 8 жыл бұрын
How can this be integrated with a select function? Like
@Joshua_SZ
@Joshua_SZ 11 жыл бұрын
The tracking is very cool when executed, what's that? Firefox?
@pagework60
@pagework60 12 жыл бұрын
Thanks I love all your tutorials.
@geeksicle314
@geeksicle314 9 жыл бұрын
The form would always refresh after using $_POST['submit'] in an if statement with the button. Now I see how to do this, because often times, the form submits multiple times and I get like 12 entires of the same information in my SQL Database! Thank you :)
@sairajdas6692
@sairajdas6692 5 жыл бұрын
Is there any video preceding it? I can't figure out how the code works.
@this-self
@this-self 12 жыл бұрын
Hi. In the previous version of this video, you used fadeIn() on the result div. It was pretty cool. How would you implement fadeIn() in your global.js file? Because this line does not work: $('#result').text(data).fadeIn();
@bawbawsumhpa
@bawbawsumhpa 9 жыл бұрын
If I set input type="submit" in html page, data from the method $('div#name-data').text(data) just flash a millisecond and disappear. But this is not the case if I set the input type to "button" instead of "submit". But in your video, even though you set the input type to "submit", it seems to be working. Why is it that?
@shurui91
@shurui91 10 жыл бұрын
what if there is more than one Alex in the database with different locations? what part of the code needs to be changed?
@DorrellWilson
@DorrellWilson 9 жыл бұрын
I've been watching a lot of your videos, you're an excellent teacher.
@iSuperDuper
@iSuperDuper 11 жыл бұрын
hi alex , how can i make auto scrolling data from MySQL ? using jQuery
@Asimov16
@Asimov16 11 жыл бұрын
Very good tutorial and I got it to work. Even upgraded it to MYSQLi too, but I have a different problem now. I want to out the values returned into a table with input forms which I have done with $('#partnumber').val(data); but I want to return more than one set of data eg part number and location. I tried two echos $row = $result->fetch_assoc(); echo $row['PartNumber']; echo $row['Location']; but this returns it together. is there any way to return separate data? Hope I am clear
@renesteneker9751
@renesteneker9751 9 жыл бұрын
Very nice guide. Any suggestions on how to implement such thing in laravel?
@cyanideneko8795
@cyanideneko8795 3 жыл бұрын
Is there a C# version for this you can recommend? 🥺🥺🥺
@rezefangz
@rezefangz 11 жыл бұрын
Is there a way to do this, except with a file, like a .txt or something?
@manualvarado2212
@manualvarado2212 7 жыл бұрын
Thank you! This wasn't directly what i was attempting to do, but this helped me to understand .ajax and .get/.post. Really really thank you.
@schumibr1
@schumibr1 12 жыл бұрын
Can you make something like a loading image? I mean after I press the grab button a .gif will be displayed until de actual data is shown from the sql?
@InnovatorAlvin
@InnovatorAlvin 8 жыл бұрын
the database connection and retrieval don't appear to apply anymore as i received a kinda obselute message. I got it working by using mysqli_connect, mysqli_query, and mysqli_fetch_assoc. I'm on WAMP server.
@ThaRSGeek
@ThaRSGeek 11 жыл бұрын
How can I make it so it keeps checking if there is a new value posted in the db it automatically updates on the page
@RQCKQN182
@RQCKQN182 9 жыл бұрын
Awesome video! Thank you! Please help me to alter my output so that it is processed. At the moment my output is just: 31John.Smith How do I get it to output a proper row on a table? Does it relate to global.js line 5 at 9:38?
@Baiev
@Baiev 5 жыл бұрын
Perfect explanation...
@SuperMegaStyle
@SuperMegaStyle 9 жыл бұрын
Nice tutorial! Thank youCodesource
@jinixvomitorium
@jinixvomitorium 11 жыл бұрын
This is very helpful! also I am wondering how to transfer a $_GET from an index page to the jquery page that passes it to the PHP file that processes the query.
@timbodude2009
@timbodude2009 7 жыл бұрын
Exactly what I was looking for. Thanks
@venkman_uk
@venkman_uk 11 жыл бұрын
me too. doesn't work without. also finding that the name.php alert doesn;t work if you've put the inputs inside a form tag.
@nicoekkart
@nicoekkart 12 жыл бұрын
Isn't it better if you use submit instead of click. So you can also just press enter.
@TranceSerbia
@TranceSerbia 9 жыл бұрын
What if you do not want to echo out data in you php file ? Can you still send it back to jquery post method and use it ?
@karlpokus
@karlpokus 11 жыл бұрын
would return (JSON_encoded obj) work as well as echo?
@yashrajbasan2689
@yashrajbasan2689 7 жыл бұрын
But how you can get row which is recently added without refreshing the page?
@MrGeekYass
@MrGeekYass 9 жыл бұрын
is there a Video on how to do the same thing but in Chat System without refreesh using Jquery ?
@AdikaAlchemist
@AdikaAlchemist 11 жыл бұрын
is it work with table within it?
@sebastianrodriguezcastella9528
@sebastianrodriguezcastella9528 10 жыл бұрын
How can I do that with a Dropdown select?
@DomutaMarcel
@DomutaMarcel 11 жыл бұрын
An verry good tutorial for an begginer like me. Thanks :)
@dannyemmerik1556
@dannyemmerik1556 9 жыл бұрын
Thanks, I can now grab the output of my query and put this in a jquery dialog box. Only my problem is that the entire content that already exists in that div is now replaced with only the query output. Any help?
@koelekoetjes
@koelekoetjes 9 жыл бұрын
I myself am still learning, but you should be able to use .= if using php or += when using js/jquery to add on to the current content. Please correct me if i am wrong though.
@joachimsome7228
@joachimsome7228 10 жыл бұрын
Great tutorial, it worked for me. I am a newbie and want to know how we can apply this to a form tag with different labels?
@neilharveyjaloog9341
@neilharveyjaloog9341 11 жыл бұрын
nice tutorial man !. , btw how to get 2 or more variables from database ? ex. i want to display age and location of the name i inputed in textbox . if i have age in database that is.
@danishjamil7677
@danishjamil7677 10 жыл бұрын
nice tutorial dude... but mysql to mysqli conversion is lil confusing now but yet nice video. keep on pumping out your tutorial contents, very informative and helpful for our career. ;)
@fahadshinwari6844
@fahadshinwari6844 8 жыл бұрын
does it support html becoz i am taking pictures from database and want to show the them on frontend but its not happening
@websachi
@websachi 8 жыл бұрын
This is very useful video tutorial, thanks so much
@CantThinkOfNameOmg
@CantThinkOfNameOmg 11 жыл бұрын
In my name.php file I want to echo Test surrounded with paragraph tags. However, instead of my webpage display "Test" as a paragraph, it displays "Test" with the actual paragraph tags visible next to it. How can I echo "Test", but keep some paragraph tags on it?
@Spad223
@Spad223 3 жыл бұрын
Amazing tutorial, thank you!
@CreativeDirektor1982
@CreativeDirektor1982 12 жыл бұрын
Very Good tutorial, very sample tnx!!!
@georgeowusu7134
@georgeowusu7134 7 жыл бұрын
I need help i want to use number to grab all the data on the row
@Rezzworks
@Rezzworks 11 жыл бұрын
Is yours not returning what is in the database? That's the problem I am having too.
@therc23
@therc23 6 жыл бұрын
Hi Nice tutorial Can you please help me with this? How to create divs automatically and populate them with records from your database
@graham8377
@graham8377 9 жыл бұрын
Excellent video good job thank you.
@prashantbedekar5615
@prashantbedekar5615 9 жыл бұрын
Really good tutorial. But i am having one query and it is related with jquery. In my application, i am displaying users data in tabular format on a web page. One column contains username and other column contains a checkbox with value equals username fetched from mysql database. I have kept username unique. Below the table, i have taken a dropdown combo and one submit button. All this is embedded in a form. Now, depending upon multiple checkbox selection (i.e. multiple users selection) and single dropdown selection, i want to pass all usernames along with selected 'action' in the dropdown. The dropdown values contain Approve, Unapprove and Delete actions. If ''approve' is selected, then all selected users should receive an approval mail. Similarly for 'unapprove' it should happen. Is this functionality possible using jquery and also displaying approval / unapproval messages without refreshing the page.
@prettyprinted
@prettyprinted 9 жыл бұрын
+Prashant Bedekar This is possible. You can send over all the users you selected and approve/unapprove to the server and have code there to either approve or unapprove all of them. Then the server could send a response with the users that were successfully approved or unapproved and you could handle that response in jQuery.
@lukaspfulb3167
@lukaspfulb3167 8 жыл бұрын
the javascript file is not working when it is in a seperate file...any ideas?? path is correct and its also not working with $(document).ready(function(){
@HenriqueVanKlaveren
@HenriqueVanKlaveren 8 жыл бұрын
Very nice. Thanks!
@Ones_
@Ones_ 11 жыл бұрын
Hi alex, what if the database is being update, how can we update the name.php without being refresh?
@BassemFouad
@BassemFouad 7 жыл бұрын
You are great, many thanks
@KingVentas
@KingVentas 11 жыл бұрын
Mine was not working and it's because a was using ' ' instead of `` when selecting db and table.
@talhakhan4608
@talhakhan4608 10 жыл бұрын
its soo use full thanks allot .
@joshuadelfin7495
@joshuadelfin7495 9 жыл бұрын
sir can you upload a video... when the user type a keyword it will display automatically searched data into table format
@memres217
@memres217 12 жыл бұрын
Great Tutorial
@sergeyshishkin82
@sergeyshishkin82 11 жыл бұрын
Hello It is good exsample for begginer Thanks
@dashing3201
@dashing3201 11 жыл бұрын
very good tutorial. thanks
@Colstonewall
@Colstonewall 9 жыл бұрын
The only thing I don't get is why use "===" in the if (isset($_POST['name']) === true && empty($_POST['name']) === false) part of the code? If you're just checking a boolean, why use the "===" tripe equals instead of double? Anyone?
@مقاطعمترجمة-ش8ث
@مقاطعمترجمة-ش8ث 4 жыл бұрын
Fun fact that I'm moving slowly from PHP and web-developing to C/C++ and desktop developing , looks like I wasn't able to make any progress with it , I craving to my old days and my first language I learn C .
@aziaja
@aziaja 12 жыл бұрын
good point and very realistic :)
@chriswillier5075
@chriswillier5075 8 жыл бұрын
Excellent Thanks
@ilinadiakarim9071
@ilinadiakarim9071 8 жыл бұрын
I want to do like this but without button. I create a form. If I insert id from table product in text box, all information from table product will show up automatically in textbox product name, textbox product price. Then I can add more than one product in that form without submit it more than one time.
@derk6831
@derk6831 7 жыл бұрын
you can use onkeyup or onkeypress....... if you want to do without clicking a button...
@CageyLastToKnow
@CageyLastToKnow 10 жыл бұрын
Many thanks for you help, what i wanted to do works now thanks to you :D
@derk6831
@derk6831 7 жыл бұрын
Simple and awesome tutorial, I have done this similar tutorial using just php and MySQL, I did not include ajax.. Is it secure that way? but the way I don't have lots experience..
@GhostInTheShell3000
@GhostInTheShell3000 12 жыл бұрын
BRILLIANT! THANKS!
@christinedaray3190
@christinedaray3190 8 жыл бұрын
what if the data are stored in a postgre database? and you have to return an image?
@devjobin475
@devjobin475 7 жыл бұрын
To return an image you can simply use the location and then reference the location + file name.
@mitagavit
@mitagavit 10 жыл бұрын
Thank you for the tutorial... was a great help
@vernielariosa9838
@vernielariosa9838 9 жыл бұрын
anything for mysqli version?
@svenbtb
@svenbtb 7 жыл бұрын
I know this is an old comment, but for anyone wondering it's the same, you just use mysqli instead of mysql. Mysqli is a good way to learn, but I would recommend learning PDO syntax when you get more comfortable with mysqli and PHP in general.
@kazzmi175
@kazzmi175 6 жыл бұрын
www.dropbox.com/sh/mgtpojb33yshxe9/AABUtyw17WQg0e8Sotr6t9FQa?dl=0 I made the same tutorial with mysqli version and can be downloaded from above link. mysqli is bit different.
@UmairAbbasi1
@UmairAbbasi1 11 жыл бұрын
that was awesome, cheers mate...
@xrandomteenx
@xrandomteenx 12 жыл бұрын
GOD i love this guy! He makes the awesome-est tutorials... i've learned a lot from you ALex! :D
@KimSalimVFX
@KimSalimVFX 12 жыл бұрын
how about without a button?
@soumyadipsaha2952
@soumyadipsaha2952 8 жыл бұрын
you've helped me a lot! Thank you for the awesome tutorial
@matte4749
@matte4749 9 жыл бұрын
What could the problem be? Warning mysql_num_rows().supplied argument is not a valid MySQL result resource in C:\AppServ\www\mywebsite\ajax ame.phpon line 11 The code is the same as in the video.
@bluetastic405
@bluetastic405 9 жыл бұрын
Kitteh fan I had the same issue.What I used for the SELECT-statement was an apostrophe ( ' ). What he is using in the video is called a grave accent ( ` ). It looks very similar, but the apostrophe messes up the query. I hope that solved your problem! :)
@Nightzo
@Nightzo 9 жыл бұрын
+Mathias Buchwalder Thank you for helping me solve my problem!
@malolatek9083
@malolatek9083 7 жыл бұрын
Incredible perceptiveness, thanks!
@cowietan3096
@cowietan3096 8 жыл бұрын
Appreciate this vid! Very awesome. Can someone explain what I should do if I were to get an image file name from the MySQL table and display the image? Would it be an alteration in global.js : $('div#name-data').text(data); Or should the change happen in name.php?
@meineroteBlume
@meineroteBlume 9 жыл бұрын
Very nice tutorial! Simply to understand. At the end of your video you post the mysql_result as an echo. Is it possible to post that over an $_POST to the HTML Page? I want to make a slider that always load the value of the database on the start. Sorry if my English is not quite right :) Greetings from Germany
@22mawdizzle22
@22mawdizzle22 12 жыл бұрын
Just for some perspective, let's say I'm rendering 1000 markers that all have 10 pieces of data associated with them. I only want to bring back three pieces of data initially when I render the markers. But when a user clicks, I want to go get the other 7 pieces of data for just that marker.
@manilakid3
@manilakid3 10 жыл бұрын
Great tutorial. Keep it up.
@KingVentas
@KingVentas 11 жыл бұрын
Is it possible to retrieve more than 1 result, i.e. there's more than 1 Alex and I want to show All Alex Locations.?????
@studentlife4851
@studentlife4851 9 жыл бұрын
Hi I am a beginner with this and I understand what is being done here but i want to be able to click on the grab button which will then in return give me the information from my database without having to type anything into a text box to receive information from my database .. I'm not sure if you have a tut for it already but yeah hope iv made enough sense
@AnhKim-sh5ef
@AnhKim-sh5ef 8 жыл бұрын
$.post('ajax/name.php',{name: "alex"})
@IsaacRosarioDurantecnicomp
@IsaacRosarioDurantecnicomp 8 жыл бұрын
How can i show records in html tables without refresh the page when there are new records in the data base? I have a project that gets data from the database but if i go into the project in another computer and insert something on it, i need to reload the page to see the new records in my browser, i want to know how can i make the mysql query with ajax to load the new records without refresh!
@data-caresystems153
@data-caresystems153 8 жыл бұрын
I have this same issue. I need my dynamic table to be reload when i click the submit button so that it becomes a real time update of data for those users in my organisation who are already viewing the page. I want the updated data to be loaded on the page without the page being refresh. Example, in this tutorial, say if two users are updating the database then one user can see in real-time the updates the other user in inserting. Alex please help us accomplish this. Thanks.
@PCKlickNetTV
@PCKlickNetTV 9 жыл бұрын
Thanks man!
@LeomarOsorio
@LeomarOsorio 9 жыл бұрын
Great tutorial. Thanks. :)
@mauriciorodrigues8296
@mauriciorodrigues8296 7 жыл бұрын
Thank you so much !!!!
Solving one of PostgreSQL's biggest weaknesses.
17:12
Dreams of Code
Рет қаралды 213 М.
小丑揭穿坏人的阴谋 #小丑 #天使 #shorts
00:35
好人小丑
Рет қаралды 49 МЛН
У вас там какие таланты ?😂
00:19
Карина Хафизова
Рет қаралды 24 МЛН
jQuery Tutorials: Submitting a Form with AJAX
14:13
Codecourse
Рет қаралды 207 М.
SQLite vs PostgreSQL
14:01
Anton Putra
Рет қаралды 28 М.
How to return JSON Data from PHP Script using Ajax Jquery
15:16
Webslesson
Рет қаралды 112 М.
Learn JSON in 10 Minutes
12:00
Web Dev Simplified
Рет қаралды 3,2 МЛН
jQuery Basics: POST/GET Data (HTTP Request)
14:03
Codecourse
Рет қаралды 144 М.
Get JSON Data from MySQL Database and show in HTML using PHP and Ajax
12:13
小丑揭穿坏人的阴谋 #小丑 #天使 #shorts
00:35
好人小丑
Рет қаралды 49 МЛН