Video instructions and help with filling out and completing Who Form 8815 Reload

Instructions and Help about Who Form 8815 Reload

Hello everyone I'm Rumi and in this video I'm going to show you that how you can fetch data from MySQL database using PHP and jQuery without reloading the page so the things that we need is the jQuery library you need to go to jquery.com slash download just click this link for the compressed version and I'm going to work inside this journal directory FTW are fetch data without reloading this and you can name it whatever you want jQuery and it's done and then I'm going to work on this page to index dot PHP and of course another or I'm going to name it def ok so and we also need the MySQL database and I have created one FD wrf I click that there is a table users I created for this video and the table name is users and it has two columns ID and name ok so beginning to fetch these names without reloading the page for the user ok who is using your website ok you want once it's done you need to open up the down here we're going to work copy we're going to write the code that will fetch the data from these table users ok we're going to show it right here so if you simply go to data dot PHP this page will load all the names right here if we refresh the page they if we add a new user right here and then we refresh this page the other name is going to show here but what we're going to do is we're going to back to the main directory and I've created an index dot PHP there we will use the jQuery to load this page after spin suffix seconds so that is how we can you know simply refresh the data dot PHP on the index dot PHP after specific time so but the first thing we need to do is to work on that other PHP so let's write a script to get all the data the first thing we need to do is to make a connection and I'm going to make a variable and I'm going to use the object-oriented MySQL I which stands for in true version I asked your lie the first parameter is going to be the host which is localhost and working on the lock load using zamp the second is the username third one is the password and the default password is nothing forward days and the last one is table users we're going to get test data from users once it's done we can check that if the connection a has not any other errors so connect underscore Connect underscore error sorry and if it has that property we can you know use the thumb should die connection failed connection error or whatever you name it doesn't matter okay in here the con is equal to error connect under school error it's done okay so if it has any error we're going to do it on the screen okay after that if it is connected perfectly to the table using database well here we need to add the database I'm really sorry but we key to add the database right here first out of that reloading we are going to you know put the database here in the fourth parameter and now we can you know access all the tables inside this database and we have only one table ok so here we go we're going to use the Curie going to use this method Curie we're going to put inside the variable result and the Curie is going to be select name that is the column from users that is where we're going to use the table and if dollar result num and let's go rose if it has nose greater than zero that I'm going to get the data right here using the well look what we're going to store every information in the row variable it is going to be an array okay this is the basic thing and you may already know about this and such score okay let's try to echo the name save it go back refresh no to data dot PDP my sqli node okay we figure out why prayer okay we've got the names AC and all of the names okay so we can use the concatenation refresh there we go these are the names right here and we got this right here so if we add a new name for example we're going and we type in new name and this M is added in the database back-end as you can see but nothing here but we have to refresh it to get that so what we need to do is to use the index dot PHP now and the first thing we need to do is do ok source is going to be the jQuery dance which we downloaded as you can see right here in the rudra 3jq edo jazz and right below it we can work on the G occurring right here we going to type here no comment is ready then we need to run this function let's try that if everything is working brief refresh and we should get there Eddie's blood so everything is working here perfectly so we also need to create the dev there we're going to show the data and it is going to be the dev with the ID show so we're going to use set interval interval that is the function that we're going to use now function and we're going to show the data in the in this div and that's why I'm using days that we're going to accessing this that's specific dev using and this is the Jake URI syntax okay so we're going to select that tip with this specific ID show and we're going to load file which is