Want more? Explore the library at https://www.codecourse.com/lessons Official site https://www.codecourse.com Twitter https://twitter.com/teamcodecourse.
Original source
PHP Tutorials: jQuery: Get Data from MySQL Database without Refreshing
Tags
ajax, codecourse, css, help, html, JQuery, mysql tutorial, php, phpacademy, refresh, refreshing, tutorial, tutorials, web development
Share :
- tweet
-
About the : d4mer
sistema biblioteca php Mysql(CODIGO FUENTE GRATIS)
April 12th, 2019Apache, PHP & MySql on Docker
April 11th, 2019Python Flask and Vue Tutorial – Video 1
April 11th, 2019Importing MySQL Database
April 11th, 2019sistema escolar php y mysql Codigo Fuente Gratis
April 10th, 2019Connecting to MySQL database on Wampserver from any host (Computer)
April 10th, 201945 Comments
Leave A Comment
You must be logged in to post a comment.
ManuAlvarado22
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.
kevin tsolakoy
exelent tutorial
bd
You are great, many thanks
Ashok Kumar Govsa
Best Tutorial for Beginners and it is worked for me. I want to know one advice from you. I want to output text data with html tags. I tried it but it outputs the data without converting the tags. I have used html() method as well but no use. Please guide to print the text data within html tags.
George Owusu
I need help i want to use number to grab all the data on the row
Catalin Popinciuc
<br /> <font size='1'><table class='xdebug-error xe-notice' dir='ltr' border='1' cellspacing='0' cellpadding='1'> <tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Notice: Use of undefined constant locatie_student – assumed 'locatie_student' in C:UsersCatalinDesktop 5UwAmpwwwajaxname.php on line <i>6</i></th></tr> <tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr> <tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr> <tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0007</td><td bgcolor='#eeeeec' align='right'>133096</td><td bgcolor='#eeeeec'>{main}( )</td><td title='C:UsersCatalinDesktop 5UwAmpwwwajaxname.php' bgcolor='#eeeeec'>…name.php<b>:</b>0</td></tr> </table></font> Suceava<br /> <font size='1'><table class='xdebug-error xe-notice' dir='ltr' border='1' cellspacing='0' cellpadding='1'> <tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Notice: Use of undefined constant – assumed '' in C:UsersCatalinDesktop 5UwAmpwwwajaxname.php on line <i>8</i></th></tr> <tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr> <tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr> <tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0007</td><td bgcolor='#eeeeec' align='right'>133096</td><td bgcolor='#eeeeec'>{main}( )</td><td title='C:UsersCatalinDesktop 5UwAmpwwwajaxname.php' bgcolor='#eeeeec'>…name.php<b>:</b>0</td></tr> </table></font>…..
What?!
Roberto Philippo
that was useless, so maybe show how to get database output without a form. Just when a database is updated from "not" you, make the page refresh and show the new data whitout refreshing the page. "THAT" would be a great tutorial. ๐
Angel Jean Banez
where does he get global.js? newbie here
tim pilcher
Exactly what I was looking for. Thanks
Visha
Help plz, im getting this error ๐
<br /> <b>Warning</b>: mysql_num_rows() expects parameter 1 to be resource, boolean given in <b>C:xampphtdocspuremediaajaxcountry.php</b> on line <b>11</b><br /> <br /> <b>Warning</b>: mysql_error() expects at most 1 parameter, 3 given in <b>C:xampphtdocspuremediaajaxcountry.php</b> on line <b>11</b><br />
Mauricio Rodrigues
Thank you so much !!!!
KADER DERK
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..
bitjezeverpeisek
Thanks it wouldve been so useful, but i always get the same errors when using the mysqli equivalents of the functions : /
samuel Exaud
i like that
Lukas Pfรผlb
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(){
Ici Aidan
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.
Master Knot See
Hey jerk! Nice tutorial and all but it does not work for php7! :((((
Master Knot See
how do you make the table in phpmyadmin ๐
Christine Daray
what if the data are stored in a postgre database? and you have to return an image?
chung Noel
mysqli have more and more people using it now, Code Course please add the mysqli below to your description to save the time of others. Thanks for the video.
connect.php:
<?php
$user="root";
$password="";
$dbName="db_name";
$con=mysqli_connect("localhost",$user,$password,$dbName);
name.php
<?php
if (isset($_POST['name']) === true && empty($_POST['name']) === false) {
require '../db/connect.php';
$result = mysqli_query($con,"SELECT country FROM namecountry WHERE name = '{$_POST['name']}'");
$row=mysqli_fetch_assoc($result);
echo (mysqli_num_rows($result)!==0)?$row[country]:"Name not found";
}
hassan rahman
got this error….
<br /> <b>Warning</b>: mysql_num_rows() expects parameter 1 to be resource, boolean given in <b>C:xampphtdocspractice-phpajaxget_data.php</b> on line <b>12</b><br /> <br /> <b>Warning</b>: mysql_result() expects parameter 1 to be resource, boolean given in <b>C:xampphtdocspractice-phpajaxget_data.php</b> on line <b>12</b><br />
Dan Kardell
Great job. I wasn't able to get my JQUERY to work unless I started it off with
$(document).ready(function(){
$('input#name-submit').on('click', function() {
Marwin Bete
Exactly what I'm looking for! you saved me, for that my friend you have my subscribe ๐
Cowie Tan
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?
Raj kushwaha R
kuch advance ho gya
Joseph John
Warning : mysql_num_row() expect parameter 1 to be resource boolean given
mysql_result()
expect parameter 1 to be resource boolean given
help?
Joseph John
the jquery source is not found ? plzz help really need this
alvin wong
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.
Josh Fisher
Cheers I use mysqli instead but still worked sort of
Mohammed GANNOUNI
Thank you alex <3
Fahad Shinwari
does it support html becoz i am taking pictures from database and want to show the them on frontend but its not happening
Kobid Kunda
sir i m getting this erroe
"<br /> <b>Parse error</b>: syntax error, unexpected 'location' (T_STRING) in <b>E:xampphtdocsaajaxname.php</b> on line <b>10</b><br />"
what wrong im doing i have exactly copied everything correctly
Soumyadip Saha
you've helped me a lot! Thank you for the awesome tutorial
Hicky Klaveren
Very nice. Thanks!
Krishneel Kumar
I get this error help please mysql_num_rows() expects parameter 1 to be resource, boolean given in <b>
jonathan casanueva willumsen
awesome tut, but ur too fast!
Chris Willier
Excellent Thanks
Diego Moreno
Excelent Tutorial….!!
How can data be in a table?
data=2DiegoMorenoNov20
all data print in a line but I want to print into a table like this
<tbody>
<tr>
<td>2</td>
<td>Diego</td>
<td>Moreno</td>
<td>Nov</td>
<td>20</td>
</tr>
ย </tbody>
ย please help me.. .@Codecourse
Gabriel Etim
How can this be integrated with a select function? Like
<select>
<option></option>
<optgroup>
<option></option>
<option></option>
</optgroup>
<optgroup>
<option></option>
<option></option>
<option></option>
</optgroup>
</select>
Duo Maxwell
thank you, you helped me sort things out a lot. !! ill sub and like
Betina Farias
Thanks.
Isaac Rosario Durรกn
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!
Smit Taunk
Its a great video!
I have one doubt. How to use multiple selectors for example I want to use a radio button, a check-box and a select list.
Waiting for your reply. Thanks in advance.:-)
Sachin Kumar
This is very useful video tutorial, thanks so much
PCKLICK
Thanks man!