Thank you, I did check the code, and after I could not figure it out, I copied and pasted the code exactly from your technotip site, and I still had the same issue. I will keep trying to debug and advise if I can find the solution. Thank you again for your tutorial!!
Hello Satish, your tutorial was fantastic and very helpful, thank you! I am having a bug with it though... In Chrome, everything works fine, unless I hit refresh, then it does not display any mysql data at all. It does work just fine in IE though. I tried several different machines, clearing the cache, etc. and had the problem every time. I was wondering if you had this problem as well, or if you knew what might cause it? Thank you again for such a wonderful tutorial I learned a lot from it.
$res = array(); while($row = mysqli_fetch_assoc($res)){ $res[] = $row; } print(json_encode($res)); I did it the other way. It get the same result. notice that I use mysqli_, because I think mysql_ will be remove from php in the future. nice tuts, keep it coming! =)
Hi Satish, Thank you for this tutorial, it really helped me a lot. But I got one question here. For example I have to fetch data from the db using the provided codes from this tutorial and then after fetch them, read them and use each separately to fetch other data from the db concerning the data chosen. Consider a simple scenario; lets say I have a db with doctor table (with attributes name, specialty and status). In html view I have a button that when clicked will fetch array list of all specialist from the table excluding duplicates (eg. cardiologists, dentist, dermatologist etc.) and show them to the html list, then after within each specialist group there are list of doctors that is when I click may be cardiologists then I will be able to fetch list of array doctors names from the table where their specialist is cardiology and this should be the same when I click dermatology list and others. And lastly, when I click each name of the doctor fetched the status information from the doctor table will be fetched to see whether there are available or not available. This is like a series of actions. Please Help how to do so.... Regards.
Hey Satish, you are a fantastic teacher. I just want to have more and more of the cool things you can teach us. Other people do thesame thing but the effect is never thesame. You are gifted with that magic that other people don't have. Although I say magic, but I think the key word is patience. 1 thing: I went to technotipDOTcom and somewhere we can pay to learn more, but I didn't see a clear content list of the diffent courses and what their topics are. It looks like I am missing something?
I followed your other tutorial on how to insert data into a db with jquery without refresh and got it working fine. I followed this tutorial and also got it working fine. How can I combine the two so I can insert data into a db from a form and have it display the posted info from the database with no refresh ala facebook status updates or twitter?
nic3 video.. can you make a tutorial video, by using "moda"l that can display data and every time i click the modal the data will also automatic refresh.. if the data in database was change?
before I check your code ..make sure to visit the link present in the description section of "inserting record in sql" video tutorial. There I've posted all the code, please compare your code with the one I've posted on my blog. That's the easiest method to correct your code.
If you know the echo function in php you can print anything from database in anywhere. The trick in echo function is the " " ' ' . Analyze it and you will unlock something!
Satish thank for sharing, i copy and paste your code from techonotip but its not working please help my i am going to design a one to one chating system using this concept. i also connect jquery properly, and create the database. plz help me for this.
hi i need help about inserting the data into mysql through PHP script i m doing the same but my fields in the form are not bringing the data to my insert.php file in which the insertions code is written pelase guide me if you can thanks
since everything is inside my local system it'll fetch the data in fraction of seconds, so I simply wanted to show you a bit of delay - like the real applications do!
+Kyle Smith In file DB.PHP make this changes to use "mysqli" $conn = mysqli_connect(DB_HOST,DB_USER,DB_PASS,DB_NAME) or die(mysql_error()); in FETCH.PHP make this: $query = "SELECT * FROM people"; if(mysqli_query($conn,$query)) { $res = mysqli_query($conn,$query); } else { echo "Bad Connecteion"; } this works for me :)
the "or die(mysql_error());" should only ever be used for debugging and/or back-end testing - as a security precaution it should not be presented to the public facing side due to the fact that it can easily give away critical elements of your database structure - rendering the use of mysqli meaningless.
None of this is working for me...I did the coding exactly as you did but the json data did not show in index file. The json data format displayed in the fetch.php file but when I run the index file, nothing shows up...why could this happened? Any idea?
You can look at this link ua-cam.com/play/PLM4pPs1mzl_MnAMZT1vIPLRDIMRCFt7mB.html But this is not the complete list and most of these PHP tutorials are very basic. I would advise you to start learning objective php directly. OR if you have choice, you can go with MEAN stack instead of PHP.
+Umesh akshayan you should edit the MyScritp.js and remove the white spaces, it will work in this line $("ul").append("Admin ID: "+this['admin_id']+....etc make them all in one line
Good tutorial, What if i have parameters to pass and how can i insert data Page without reloading, my code is something like $.post('fetch.php',{param1:paramval1,param2:paramval2)},function(data){ },'json')
dear i m not using jquery yet, i m new to php and was watching ur earlier tutorial with inserting records in sql using php, if you give me ur email address then i will send u the source files to look at if possible these are not bigger files just 5-10 lines.
You mayke doing something as this. This gives you less code :) $(document).ready(function(){ nameOfFunction(); setInterval(function(){nameOfFunction();},5000); });
+Cantuğ Çavuşoğlu you should edit the MyScritp.js and remove the white spaces, it will work in this line $("ul").append("Admin ID: "+this['admin_id']+....etc make them all in one line
Thank you, I did check the code, and after I could not figure it out, I copied and pasted the code exactly from your technotip site, and I still had the same issue. I will keep trying to debug and advise if I can find the solution. Thank you again for your tutorial!!
Hello Satish, your tutorial was fantastic and very helpful, thank you! I am having a bug with it though... In Chrome, everything works fine, unless I hit refresh, then it does not display any mysql data at all. It does work just fine in IE though. I tried several different machines, clearing the cache, etc. and had the problem every time. I was wondering if you had this problem as well, or if you knew what might cause it? Thank you again for such a wonderful tutorial I learned a lot from it.
$res = array();
while($row = mysqli_fetch_assoc($res)){
$res[] = $row;
}
print(json_encode($res));
I did it the other way. It get the same result.
notice that I use mysqli_, because I think mysql_ will be remove from php in the future.
nice tuts, keep it coming! =)
Excellent video tutorial! Clear and concise.
Hai sateesh.... thnx for the tutorial... it works properly...
please include image uploading and downloading tutorials.....
holy shit, i have been looking for this exact thing for the past 8+ months, thank you.
Thanks a lot Nasser ..
All these feedback means a lot to me. Thanks again
Thanks Satish, For sharing your talent with us
Hi Satish, i want to thank you for this tutorial, i learned a lot from it.
Great explanation on how it works! Excellent!!!
Hi Satish,
Thank you for this tutorial, it really helped me a lot. But I got one question here. For example I have to fetch data from the db using the provided codes from this tutorial and then after fetch them, read them and use each separately to fetch other data from the db concerning the data chosen.
Consider a simple scenario; lets say I have a db with doctor table (with attributes name, specialty and status). In html view I have a button that when clicked will fetch array list of all specialist from the table excluding duplicates (eg. cardiologists, dentist, dermatologist etc.) and show them to the html list, then after within each specialist group there are list of doctors that is when I click may be cardiologists then I will be able to fetch list of array doctors names from the table where their specialist is cardiology and this should be the same when I click dermatology list and others. And lastly, when I click each name of the doctor fetched the status information from the doctor table will be fetched to see whether there are available or not available. This is like a series of actions.
Please Help how to do so....
Regards.
very good....wonderful
Hey Satish, you are a fantastic teacher. I just want to have more and more of the cool things you can teach us. Other people do thesame thing but the effect is never thesame. You are gifted with that magic that other people don't have. Although I say magic, but I think the key word is patience. 1 thing: I went to technotipDOTcom and somewhere we can pay to learn more, but I didn't see a clear content list of the diffent courses and what their topics are. It looks like I am missing something?
this is great working properly. please let me know how can I put MORE button.that can show one sentence and after clicking more every displace.
Thanks man. This is exactly what I was looking for.
I followed your other tutorial on how to insert data into a db with jquery without refresh and got it working fine. I followed this tutorial and also got it working fine. How can I combine the two so I can insert data into a db from a form and have it display the posted info from the database with no refresh ala facebook status updates or twitter?
thank you for such a good tutorial,, i have a question ,, can we convert a web app to an app using phonegap?
this is exactly what i am looking for! Thanks so much!
is it possible for you to show me how to do this on joomla please?
hey man, great tut. appreciate your effort
Thanks for your videos! How can I do to bring data from my Google spreadsheet to a site with jquery?
Great Tutorial buddy
nice now got to know how to get data from db using just creating json data
thank you,its very usefull for me.
Perfect!; thanks.
Thank you! Great tutorial, very helpful...
very nice tute...
if i want to display images in different divs how can we do that ???
Thank You!!!!!
you making my life easier! thanks! :D
nic3 video.. can you make a tutorial video, by using "moda"l that can display data and every time i click the modal the data will also automatic refresh.. if the data in database was change?
Well done ! How can we display it like facebook notification. I mean how to write the code in jquery to display.
vry nice tutorial
Thanks alot for a great tutorial!
Thanks man really appreciate
thank you satish, but what if i want to make the newest data always at the top place ? can we do that ?
Thank You Very Much for the help sir! :)
Excellent !!
Excelente!
Very very Good!
before I check your code ..make sure to visit the link present in the description section of "inserting record in sql" video tutorial. There I've posted all the code, please compare your code with the one I've posted on my blog. That's the easiest method to correct your code.
thanks for the tutorial, very helpful :)
thanks nice tutorial ! thumbs up
thank you ..
thanku yar
thanx dude.
can u do an example on refreshing table
awesome!
problem solved problem was in php page which i was calling by in getJSon function..
thanks for reply
how to make the output text to specific UL (like get element by id) to view the data in it?
Nice
can i ask where did jSon array folder came from and the folder script too?
Thank's Man
nice to know that it helped ..
tks
awesome ... (y)
this one is very good. but can you teach me how to put it inside the table. :)
If you know the echo function in php you can print anything from database in anywhere. The trick in echo function is the " " ' ' . Analyze it and you will unlock something!
How do I append the data to a table in rows and columns instead of ordered list. Thanks.
Got it.
Satish thank for sharing, i copy and paste your code from techonotip but its not working please help my i am going to design a one to one chating system using this concept.
i also connect jquery properly, and create the database.
plz help me for this.
I want the first jquery plugin...
hi i need help about inserting the data into mysql through PHP script i m doing the same but my fields in the form are not bringing the data to my insert.php file in which the insertions code is written pelase guide me if you can thanks
Please explain why do you set a time delay of 0.2 sec thanks.
since everything is inside my local system it'll fetch the data in fraction of seconds, so I simply wanted to show you a bit of delay - like the real applications do!
i'm trying it but it's telling me that the my_script.js file has a problem ?
I love you
i want to display data from database using ajax in php by onload function.
Some of the PHP like mysql_fetch_array isn't supported in PHP 5.5 you should make a new video.
Kyle Smith not needed. This video is just to get the Idea for retrieving and consuming json in PHP .
+Kyle Smith
In file DB.PHP make this changes to use "mysqli"
$conn = mysqli_connect(DB_HOST,DB_USER,DB_PASS,DB_NAME) or die(mysql_error());
in FETCH.PHP make this:
$query = "SELECT * FROM people";
if(mysqli_query($conn,$query))
{
$res = mysqli_query($conn,$query);
}
else
{
echo "Bad Connecteion";
}
this works for me :)
the "or die(mysql_error());" should only ever be used for debugging and/or back-end testing - as a security precaution it should not be presented to the public facing side due to the fact that it can easily give away critical elements of your database structure - rendering the use of mysqli meaningless.
good code sir cna your give index.php code bech on website it only showing js file
from where i get jquery-1.8.2.min.js ?
How you do it if you have images in your array?
Thamk you mr alex
First make sure the php files are working.. then implement jQuery to it.
None of this is working for me...I did the coding exactly as you did but the json data did not show in index file. The json data format displayed in the fetch.php file but when I run the index file, nothing shows up...why could this happened? Any idea?
hello sir where is your php tutorial playlist please provide me link
You can look at this link ua-cam.com/play/PLM4pPs1mzl_MnAMZT1vIPLRDIMRCFt7mB.html
But this is not the complete list and most of these PHP tutorials are very basic. I would advise you to start learning objective php directly. OR if you have choice, you can go with MEAN stack instead of PHP.
i copied all the code from your website but it's not workin, the php file is working but there is nothing displaying in index.html
+Umesh akshayan I was wondering you got it working? I got it up to fetch.php, but index.html display blank. Spend 2 days, no luck so far.
+Arthur Chang same here
+Umesh akshayan you should edit the MyScritp.js and remove the white spaces, it will work in this line
$("ul").append("Admin ID: "+this['admin_id']+....etc
make them all in one line
how can i print it in a descending order
+alhussain taher
edit this query : SELECT * FROM people ORDER BY 'name' DESC
you just add some statement with ORDER BY
i followed all the steps but i dont seem to see any display in my main html
same here
Can anyone help in integrating facebook login,g+ login,twitter login in a website which is built in codeigniter using hybridauth
thanks but this not working in ie
Good tutorial,
What if i have parameters to pass and how can i insert data Page without reloading, my code is something like
$.post('fetch.php',{param1:paramval1,param2:paramval2)},function(data){
},'json')
when I try to select the text, it does not select
I want that first jquery file jquery file..:-)
I think the table people at the start is called info (by mistake)
Even so, the code doesn't work
Finally, it worked! I did the mistake to include additional echo statements in the fetch.php file. This spoilt the functionality of my code.
i have problam not going in side this function
$.getJSON("j_db.php",function(data){
Here we are pinging database for every 2 sec? is it?
u have any vediosites for learn core java, php,html,j2ee and free down load ebooks send me address.........
thank u for reply
dear i m not using jquery yet, i m new to php and was watching ur earlier tutorial with inserting records in sql using php, if you give me ur email address then i will send u the source files to look at if possible these are not bigger files just 5-10 lines.
You mayke doing something as this. This gives you less code :)
$(document).ready(function(){
nameOfFunction();
setInterval(function(){nameOfFunction();},5000);
});
I waste my all one day. I tried everything. It didnt work :/ Php is working though.
+Cantuğ Çavuşoğlu you should edit the MyScritp.js and remove the white spaces, it will work in this line
$("ul").append("Admin ID: "+this['admin_id']+....etc
make them all in one line
sir please make video for comments like youtube plzzzzzzzzz
give me ur email. I wil send all the coding
you need a bigger vocabulary