Want more? Explore the library at https://www.codecourse.com/lessons Official site https://www.codecourse.com Twitter https://twitter.com/teamcodecourse.
Original source
Want more? Explore the library at https://www.codecourse.com/lessons Official site https://www.codecourse.com Twitter https://twitter.com/teamcodecourse.
Original source
45 responses to “PHP Tutorials: jQuery: Get Data from MySQL Database without Refreshing”
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.
exelent tutorial
You are great, many thanks
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.
I need help i want to use number to grab all the data on the row
<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?!
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. 🙂
where does he get global.js? newbie here
Exactly what I was looking for. Thanks
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 />
Thank you so much !!!!
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..
Thanks it wouldve been so useful, but i always get the same errors when using the mysqli equivalents of the functions : /
i like that
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(){
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.
Hey jerk! Nice tutorial and all but it does not work for php7! :((((
how do you make the table in phpmyadmin 🙁
what if the data are stored in a postgre database? and you have to return an image?
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";
}
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 />
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() {
Exactly what I'm looking for! you saved me, for that my friend you have my subscribe 🙂
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?
kuch advance ho gya
Warning : mysql_num_row() expect parameter 1 to be resource boolean given
mysql_result()
expect parameter 1 to be resource boolean given
help?
the jquery source is not found ? plzz help really need this
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.
Cheers I use mysqli instead but still worked sort of
Thank you alex <3
does it support html becoz i am taking pictures from database and want to show the them on frontend but its not happening
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
you've helped me a lot! Thank you for the awesome tutorial
Very nice. Thanks!
I get this error help please mysql_num_rows() expects parameter 1 to be resource, boolean given in <b>
awesome tut, but ur too fast!
Excellent Thanks
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
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>
thank you, you helped me sort things out a lot. !! ill sub and like
Thanks.
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!
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.:-)
This is very useful video tutorial, thanks so much
Thanks man!