 Welcome back to the channel. In today's video I'm going to show you how to work with an API that requires you to pass in an API key or series for you to use their data and then we shall store this data in our database and then we shall retrieve this data and then showcase it on the front end. So it's going to be a three-part step and I'm going to show you all of this so I hope you can pass it via through so that you can learn much more. So I'm on the New York Times Developer API which is open and you can create your own account. So I've created my account and I'm going to go ahead to make some apps. So the first requirement you will have is to make an app. I'll choose an app, I'll give it a name, I'm going to call it YTWP and then I'll say this is for my YouTube WP API development plugin. So this will be the name of my app and description and I'm going to just choose something that's going to be from the Books API. So I just want to get all the New York Times bestseller lists. Maybe I'm working on a website that is a bookstore. So I'll create this and then I'm going to be given an app ID. Then of course I'll have also a key that I'm going to have here. So I'm also given a secret that I can use. So I'll have this key and I'll have this secret. So the first thing that I will do is go to my editor, open it up and I'll go to my local site or one on the server and open WP content. Then I will go to the plugin section and I'm going to create a new folder which I'm going to call YTWP Books API. I'm going to just get this and drop it inside my editor. So after adding it in my editor I'm going to create a new file that will start this and then I'll add on dot PHP. Now inside here I need to open this up with PHP because it's a plugin written in PHP and I'll start up the things that are needed by WordPress to recognize that this is a plugin. So I'm going to add my name of my plugin that YouTube WP Books API and then I'll add of course my link. I'll add a name here and then of course I'll say this plugin brings in the Books API the New York Times and I'll give it a version of that then I'll change this to GPL2 so that anyone can use it by just fuking this and then I'll just give this the same, I'll give it the same text domain as my plugin because that's the standard of WordPress. So the first thing that I will do is add a little bit of security and I'm going to look for the abs path which is a constant that is defined in WordPress so we are looking for this constant called abs path if it is defined then we should proceed if it's not then we should die. So that's what we are saying define the abs path or die and after doing that I'm going to save this I'll go to the admin of my plugins go to the plugins here and on reload I'm going to activate this plugin and once I activate it we don't have any issues so meaning it is very very okay so the first thing that I will do on getting my plugin here is I'm going to copy these details from the dev portal I'm going to copy the app ID because I'm going to look at the requirements of the API and then I'll base on that so we have the app ID which I'll just comment out here but we need it then I'm going to also copy the key and then I'll also get the secret so I'll copy this come back to my editor and then I'll have the secret so the reason I'm doing this is so that I don't have to keep on checking already have all this information I'll just save this as app ID is equal to that it's going to be a string and then I'll change this key it's equal to this as well and then I'll have a secret so a secret is equal to this string and a semicolon and I think we are good to go so I've saved those I can always use them whenever I need them so I'll come back here and we have our books API and we are ready to go so when we go to get started we register the key get the API and then we need to go to the API page and we'll just look at the books API so I'll come to this page where I'm just getting the best servers and I'm getting the history or maybe it could be names depending on what I want I'll click authorize and then of course I'll need to enter my app here and then I can also manually enter the key if I want to so I'll add the key that we had already stored so let me just copy it from here copy this here paste it give this an authority and say okay so in here just to try this API I'm going to set an offset of 20 because that's the minimum you can set or click execute and we'll come down here and we're going to see that we get a status of okay and we get the different pieces of information down here so I think this will be good for us to use so let's go and try this inside our own page so the first thing I'll do is add I'm going to add an action here and the action that I'll be looking to deal with is admin menu and here we shall add our own function that will help us to run that so I'll call this take a press add menu page and once I'm done with that I can now start writing this function so I'll say take a press add menu page of course I'll run the one function before it and then I'll have our function coming in here so in here I'm going to add I want to run the add menu page function and what it requires a title from us so I'll add a page title and the page title will be ny bestsellers and then at the end put a comma then we shall have a menu title which I am going to just duplicate then we'll add a capability and I'll just say manage options put a comma I can always change this to administrator or any of the capabilities that are available in wordpress and then what I'm going to do next is add a menu slug and we can always just get our slug from here and just add it here to look like the plug in itself then we need to add a callback function which we're going to say get books api add a comma then we need to add an icon URL so I'll just use dash icons or say dash icon book and that's what I'll use I'll use the book dash icon and the position I'm going to use right now is I'm going to be a bit intrusive and just say let me get to 16 so once I'm done with that I'll just take these away of course add a semicolon here and then I'm going to get this callback function and just write it as empty get books api I will do this then I'll say all I need to do is echo and say hello so that we can see what's happening so I'll save this because I forgot a comma here and that's the beauty of our editor it's telling us that there's something wrong so let me increase this so that you can see it so I'll save this come back into my admin area and then I'll reload and you'll see that we have a new nyt bell seller admin page right here so click on this and you'll see that we have our hello here so the reason I can I'm doing this is so that we can see our api call and the data we're getting before we actually throw it inside our database so let me go back here and start working on that so when we're going to use api is we use wpremote get post and these are default towards press now in here of course I'll need the URL which I am going to use so I'm going to get that from our page so I'll go back to the portal and pick this http link come back here and I'll add it right there and then of course we're going to have some arguments that we shall need to pass so I'm going to come and set up my tags here of course this is going to be an array of those arguments and inside here as well put our headers we'll put in our body and all those things so I'll say headers of course I need to wrap this inside single cuts and then I'll append an array of the headers put a comma we'll do the same for the body now let's go back to our documentation in the api and we'll see that it has a requirement for query parameters to be passed and that simply means we're going to add a question mark to our api here and we're going to pass in the different parameters that are here for example we have the offset which should be a multiple of 20 you need to pay attention to some of those details now you will notice that this api you can query by title by publisher by price and so on but I'm not going to look into those details but what does it mean to use query parameters so when we have our HTTP request all we are going to do is add some question mark here at the end of the line and we shall pass in those individual queries so let me come back here and this is what I mean so I'm going to change this to double quotes so that I can write more PHP inside here so we're going to add a question mark then we are going to have api dash key which is the first requirement and we'll say it is equal to then I'll add our sign here and say it's equal to the key now of course the key is not available in this function and I need to bring it down here because it won't be accessed from here so I'll cut it bring it and add it right here now after adding the key we also have to add the offset so I'll add and then I'll type offset is equal to 20 now once our URL is saved up we're able to get a remote post and we can get that information so I'll just call this our response from the api and I'll save it inside a variable now depending on the api some require us to pass in headers like the content type so you could pass in content dash type for example your details like application slash jason because that's the way wordpress works even if you don't add this content type this remote gate and remote post are always going to send out a content type of application slash jason now of course some apis require you to pass in maybe a username in here a password it could also be the api key or a jason gwt token which is a json token you could pass all those through the header it could require you to have particular parameters inside your body to query the api but this one in particular is saying we need to just pass query parameters on the URL so what we're going to do here is I'm just going to verdamp our response so I'll save this go back to our admin area inside wordpress and I'll reload this of course go to our new yorks bedseller and as this page opens we get our api to be called and you will see that we get back proper information from here we have a status of 200 which is okay and then we have information coming from here so let's strip that information and then we shall use it down here so what I'm going to do is come back here and say we want to get the wp remote underscore retrieve and what we want to do is get the body and the body will be from the response now this is a default wordpress function that helps you just get only the body that you get from the api so once we do that we'll be able to get our body so I'll save this inside a variable called body and then I am also going to get our response code and I can get that by using the wp remote retrieve remote retrieve response code and we can get it and then also save it inside that particular variable now the reason I'm saving this is because I'm going to make an if function to say if we get the wrong response let's say we get a 401 then we'll know authorization hasn't been good so if we get a 401 and it's equal to the response code then we're going to pass in a message we're going to return unauthorized access we shall do another if statement and say if it is a 200 if it's not 200 just generally to say if we're not getting a proper status we'll just say error in pinging api error in pinging api so we always know what's going to happen and then if it's 200 then that will definitely tell us that we're going to get back the body so if it's 200 we don't need to do that if statement we can just write everything here but I'll just make it proper and say if it is 200 our response code underscore code then we're going to return the body that we have here so we'll return body it's just getting us whatever we needed from here so this is a function get api books get books api now what i'm going to do is open a new function that i'm going to call run all the code because we're going to have a number of code functions doing different things all the code functions and it's the one we shall pass in here now of course i'll change the get books api to run under this function and then i'm going to get this function and then add it here as our call back so it will do the same thing what we've just done is expanded this code so that we can do simple comments like get all the api books and then here we're now going to start saying get the information stored in that database so what are we going to do in the database there are two ways of saving information in any wordpress database one you can use a transient and if you have a lot of information that's unrelated and so on you can actually open your own tables inside the wordpress database so what i'm going to do is i'm going to save this first as options now options are basically small pieces of data that are saved in the options table so let me open up my server i'll go to the database i'll open this up and opening it up you see that our wordpress database always has options in it and we can create our own tables like what we have down here so i'll go in the options and then you will see that if we select the data you'll see things like the site url which is usually the url of your site that's where it's stored when you have a blog description or a blog name those are things that are usually part of your customizer and they are accessed and they can be updated in those areas now i'm just going to go to the last sections you will see that we can have our own kind of settings so what i'm going to do is come here and say if a particular options found then we ignore but if it is not available then we are going to set it so what we're going to say if get options and that's how we get the options from that database and we're going to pass in the options name and we're going to call it the yt wp books info that's what we're going to call it for now we're going to check if it is available then all we're going to do is return we're not going to do anything okay but if it is unavailable then we should go and query our books api now that i'm going to just move this down so that we actually have better code in our process so we'll go to the api and we'll fetch that data and after fetching it so i'm going to save this as info info books for now i'll save it inside this particular variable we are then going to add options and when we add an option it expects an option which we are going to just pass as this same thing so we'll get this option because we always want to check it if it's available then we skip if it's unavailable then we have to save it then the value we're going to pass in here is this info books and then all these other things can be ignored for now because we don't need them and so let's try to run our code and see what happens so i'm going to look for these options in our database so i'll go here and look do search pass this in press enter and you'll see we don't have any rows like that but what i'll do is that i'm going to hit our new york's best seller and we have an error here get options because this is supposed to be get option not options so get option just like it is add option so i'll save this and then let me just put here a message which is a print r to say the option is missing that's one way of us following up with our code the option is missing and then i'll do the same thing after that is done after adding our option and say the option is saved so let's save this and see what happens in real time i'll reload in our database we'll see the option is missing that was run the option is saved so let's go back here hit enter and you will see that we actually have an error and it's selling us there there is an error in pinning api meaning we got an issue so i'll go back to the code here and then i'll try to see where the problem is we'll need to check the response look at the code and we see that we have a typo here for wp dash so i'm going to save this after checking that error come back and we're going to delete this option so that it's not there and then we're going to hit our new york's best seller we can va damp the response and then we have reponse code and i think that is a problem in itself so i need to just copy this and then change this reponse code so that we have it all being uniform now once this is done go back into our database i'll click edit delete this come back to admin reload and you'll see that option is missing va damp we have all the information coming in and we have option is saved so let's come back into our database look at this and you will see that when we click edit we have this whole chunk of information showing up in here now this is in our database and we don't need to call the server over and over again imagining if a server has a limit on how many times you can call that api and let's say if the data is not changing every other minute then you don't need to call out that information so this will allow your website or your application to be a lot faster so this is one way now there are other ways you can save this information by creating another database so what i'm going to do is let me just come back here and i will remove some of these which we don't need now the other way of doing it is by serving a custom table inside our database and we're going to look at that but as we look at that let me see the kind of information we have and what kind of tables we can actually just create so let me go in here instead of returning first i'm just going to get that option i'm going to get this option copy it here and then what i'm going to do is do a vadam so i have a small a small snippet that allows me to just have pre tags so i'm just going to vadam this so that we can see the information that's in there now the other thing that i'm going to have to do is i'm going to have to json decode this information because it is in json format so i'll save this let's come back and view our object so i'll come back here when i reload we'll now see that we have an object which has a status of okay so we can just pull out the okay we can pull out the copyright we can pull out the number results which is this and then we have results and that results has an array of 20 pieces of information so let me come back here and then i'll save this as our results so results will equal to json decode this and i'm going to just look for the results so i'll save it up here so what i'm doing is getting a variable of results i'm getting the json decode of this getOption and i'm just getting the results and then what i'm going to do here is vadam this save come back here reload and you will see we get our object of 20 pieces and inside this we have individual objects again so we can just pick up the title the description the contributor the author a contributor note a price and all of this so these are the things that we can probably look for and then just add them inside our database so i'll get these few pieces and these are the things that i'm going to create inside our database so i'll take note of this and say our tables should have these few things a title a description contributor author contributor note i'll just go for the minimums i'll go for price i'll get the age group i don't need to do that so let me just get the publisher so few things we know these are the lengths and we can be able to also limit our database that we shall be creating with these short things all through so let me comment this out because it will cause errors and here we are going to run a function which is going to say create create database table and then we shall save this so instead of saving an option this other time around we're going to create a database table and after creating our database table which has all this information we are going to save the information so save database table information so that will be the next step that we'll do so for now let's just create a database table and we're going to use this information so i'll copy this remove this so that it remains clean and i'll come down here at the bottom and then i'll create our function which is create database table now of course i could have created the database table at the initialization of the plugin those are the improvements you can make but i'm not going to do that right now i'm just going to make this all record and it can be later improved in terms of its development i'm just prototyping this for you but you can always write it in a better way so let's create a table here now i'm going to version our table so that in the future if we want to add other things we can always check for the table version and then create the different structures of the table so what i'll do here is say the yt wp table version and i'll say this version is going to be 1.0 so we'll call it 1.0 for now and that will be all that we need and then of course we are going to add an option in our database because we shall be using this particular version to cross check if that is the right version so i'm just going to copy what we've used here before save in that transient so i'll come here save this as options and then i'm going to get this wp table version i'll say that is so and then i'll paste this so we'll have an option of a table version and we'll always cross check to see if we have this table version then we don't need to create another table but if it's not existing then we have to create the table and then add the different fields in that particular table so i'm looking at this documentation for creating tables on the WordPress repo and that can help so we're going to look for the global wpdb and this is basically the WordPress class inside the core WordPress this is available for us to always create tables and manipulate them in different ways and if i scroll down i'll be able to see all the sample code here so i'm going first declare a global so we'll come back here and declare a global which is the yt table version that we have and we'll of course pass in this for now and then the next thing we are going to do is we'll also call the wpdb which is the class of WordPress and this particular class allows us to manipulate our WordPress database and tables and just basically do so many things so we shall call this so that we can use it as we create our table the next thing we shall do is actually get a table name and you'll see that now we are starting to use this global that we made and we're going to add a prefix to our table and the table that we shall be having we shall just give it this particular name so that we know what we are working with if our prefix of our database is wp or depending on what you've set it to be will have wp underscore then we shall have this extension right there so once we've declared our prefix for our table name we are now going to add the things that create our table so let me just copy this code i'll come back here place it then i'll explain what's going on now we'll also need to set our character set call it inside our table and the next thing that we're going to do is we're going to create an SQL statement which is going to basically create a table and that table will have the name that we have declared here and inside it we will create an id of a minimum integer a medium integer which is 9 it should not be now and it should always auto increment on its own of course we can now set the time if we want to then we can bring in all our the information that we wanted to have from here so we want to have a title and this title always has a length of nine so i'll duplicate this this right here i'll say name is now going to become title and the title will be a tiny text a title text and we can always say this is going to be 39 or whatever it is and it will not be now and then we are going to have next down here we shall need to have a description so we'll add a description our description here the size was 116 so we can always just add this as a text and then we will have it as 116 and the reason we are doing that is so that we don't have a very large database okay so i've actually taken away my title i need to have this as title so we'll have our title here which is a text and it will be 39 we'll have a description which is a text we'll give it 116 and then we are going to have a contributor which will be a string the string of about 11 so i'll duplicate this and bring this down so the contributor i can always just add as 20 and then next we have an author and i will do the same thing author just like contributor i'll leave it at 20 depending on their name then we'll have a price which will basically be taking in an integer so i'll duplicate this have the price and then i'll say this is going to be an integer of 20 and then we'll have a publisher finally who will be of about seven so i'll duplicate this have a publisher i'll change this to text leave it at 20 and then i'll take out all these other pieces that we don't need and finally what i'm going to do is just leave a primary key of the id so that we have this id as our primary key when we are checking the table but i also notice my sql has an error here so i'm going to change this to book description so that it doesn't break the word description is retained in sql so we cannot use it here so we'll have to change this to book description now once we have our sql done here all we need to do is require for this file that is part of word press and it's the includes upgrade php file and that will allow us to use the dp delta and pass in our sql to create a table so i'm going to save this now that we've finished creating all this code for making our database table i'm going to save this i'll take away this so that my code is a lot cleaner save then i'm going to come back and run it so i'll go back to the backend click this to reload of course i'll first take out this because it's going to stop our code from running come back to the new york best sellers click it it will allow the reload to run and then what i'm going to do is of course i'm going to come back to our table here and then we'll scroll down and you'll see that at the bottom of the database we have this table called wp yt wp table version just like what we had inside our code we had the prefix then we added on or concatenated this extra string so we have it in here and then we will see that we have all the different columns that we initially assigned so let's populate our information inside the individual columns that we have here so i'm going to come back to our code right here i'm going to start on the save database info so i'm going to copy this and i'll pass it in here of course i'm going to then add of course the closing and opening brackets here now of course we don't want create our database every other time we run the code so i'm going to just look for this option and if this option exists then we just skip the whole thing of creating tables so i'm going to do an if statement what i'll do is i'll pass in this create table and what i'll do here is i'll say get option and we're going to check if this option is actually true then we ignore the whole create table so if this is false meaning if we do not have this version then we create the table but if we do then we just skip that we just go and actually save our database so i'll also make some changes here it's always good to fail really fast but for this tutorial i'm going to changes and say if it is false then we should query the api add this option and then move on with life so i'm just going to move this up here and i'll say if it is false then we should get the books from the api add this option and then return otherwise if it is not false meaning that if this is actually already existing we should get the options results and then pass it as a variable inside the results so i'm saving this option temporarily as our information but what i want to do is get this and then save it in our database so i'm just going to get this code cut it from here and then we shall use it in our save info to database i'll move this comment out and say get info stored in database so that we know what's going on in this function so since we already have our results here they're being decoded and we're getting results let me just vahdamp this let me pre vahdamp this and then i will see what's next so copy this paste it here and then i'm going to come back and reload and you'll see that we have this object with 20 items so i'm going to loop through each item and then i'm going to pick this particular pieces and then i'm just going to send them over inside the database rows so all i need to do here is go for each go for each for each of the result as result i'm going to pick from each result something and then enter it inside the database so i'm going to just check this and then i'm going to pick of course the title and all of this publisher i'll paste it here so that i can just reuse it quickly so we're going to be getting the title remember this is description we have contributor we have author we have the price and then we have the publisher and of course these are going to be gotten from each of the results so i'll copy this and then i'm going to go to each one of these go to the beginning put our arrow and say we want the result we want to get the title want get the description want get the contributor author price and publisher now how do we send this information inside the database so we have to get the particular table and then insert in the particular columns we shall go back to this page and you will see that they give us a global wpdb and they share with us how we can enter this information so i'll copy it and i'll share with you what happens so i'll first paste it here so we need to get our global of the db class and we are going to already be getting the information so we don't need that we're going to get our table name so i'll just copy this table name from here and paste it here and i'm going to say for each of the results we're going to do a wpdb insert and we're going to insert in the table name and we're going to insert in the different arrays so i'll cut this and i'm going to put it inside here in our loop so i'll cut all these pieces from here and then i'm going to add them to the array that is existing here so i will do this we'll leave the time alone because we want to get the exact time i'll push this here i'll get all of this then go to the end then just use my editor to my advantage and then i'll paste all of this here so i don't need to have these comas right here so i'll clean that up have this also need to do that save this and we know that we're going to be inserting inside our database so what i'm going to do is just come back here then i'll run that we'll see that we have some errors in the database it's saying it doesn't know a description in the list so this is because this is supposed to be book description so i'll save this thankfully i have query monitor which is a plugin that helps me check for errors when i'm developing i'll reload and this time around everything went well so i'll come back here i'll reload this i'll select to see data and you'll see at the different intervals we had this information entered so i'll come back here reload this again twice and you'll see that this information is being entered all over again and again and again you can write a small script to check for the title the contributor author and publisher that if those exist in your rows of your data here then you should skip writing that particular piece of information and that code can always go right here so that will make your code a little bit cleaner but i'm not going to go into that i just wanted to show you how you can save in your database now finally we are going to query that information the way we queried our get option we can get that information and put it on the front end so equally we can get our information from the database and show it on the front end much much easily what do i mean by that i'm going to go into my themes folder i'm going wp content i'll go into my theme and right now i have 2020 as my theme in 2020 i'm actually going to create a new template for my page and i'll call it page db info so i'll add a php here at the end and of course i'm going to start with php to kick it off now to make it work as a template we need to add a comment here and say template name and we shall say this is called db info and i'll save this and i'll come back inside my admin area to a page i'll reload this sample page and when we come to template here you will see that you have the option of db info so i'll update this and if we go to view the page we're going to see that we have nothing added here so inside this page we are going to query some information and make sure that we get that information so first of all i'm going to add our header so add get header add a semicolon and i'll also get our footer and i'm just going to look at the other pages so that i get a better idea of what's happening so for example we have the index page and it has all of this running i will look at the full width template and it just has a get path singular if i look at the template cover you will see that it has all these different things so i'm just going to copy this and add it to my db info and add it to my db info and then we're just going to have our php running right here so we shall query our database and always throw this information on the page irregardless of how it looks we're just going to pick it and throw it on the front end so one way we could do that is by i'm going to just do a print r and in here we can do a get options get option and we can pass in our option that we already got so i'll get books info here and then i'll pass it in and save so if i come back here and reload you'll see that we have our header we have our footer and you can actually see our information here our footer is broken here because we do not open php again so we just have it echoing get footer so i'll save this a reload you'll see that now we have our footer but you can get this information and run it through maybe a table or whatever you want to have it do that is one way the other way of just not getting the option because we save the information in the database is we have to query the database to get this information on the front end what i'll do first is i'm going to throw this information in a table so i'm going to have to open up markup for a table of close close it at the end of the day and then i'll add a table row here and inside that table row i'm going to add a number of tds and what i will do is let me just copy what we have here i'm going to come and paste it here then i'll use my editor to help me set that up real quick so i don't need the time we have a book description title book description author so let me do this quickly with my editor i'll take that off and then i'll close off the td come to the beginning and open up the td so i have title book contributor author price and publisher already here so i'm going to do the same thing for all my php that will be coming so i'll take out the time as well i'll take that out and then we'll use that as a template for what we are going to do now inside this php we are going to query our database directly now there are two things one is us querring the options that have been said so that one is really easy all we need to do is just say get option right here come back to this page and look for this option that we saved which was get the books info so i'll copy this and then i'll add it in here and all we need to do is be able to loop through and get that information so let me just print r to show you the possibilities of this so i'll print r hit save let me comment out this table so that it's not broken save this come back to our front here we're going to go to our front page we're going to reload and once we reload you'll see that we have all this data showing up right here but that's not the main goal i want to go into my database table and pick the same information so i'm going to come back here i'll undo the tables that had commented out so the first thing that i'll need to do is use the global wpdb which is available for us and after getting the wpdb i'm going to use a method that is part of that class and it's called get results that's the method we shall be using now in here we're going to add our sql query because we're going to query directly from the database i'll start on my sql variable here double quotes and then i'll come back i'll add select all the rows from and we need to add the table name so i'll have to add table name now this table name i'm just going to copy what i have used before so we'll have a table name is equal to i'll come back here and i'm just going to look for this this that we have here and then i'll add it of course we are saying get the prefix then get this particular table where we save that information so we'll save that in isql and so i'm going to be getting the results right here so i'll save this also in its own variable and call it table underscore info and the reason i'm saving it in a variable is because i want to loop through it so why would i loop through it let me just print r for you so that you see what's in this we'll get the table info i'll save this come back here reload and you'll see that we have an object with all this information right through here and if i was to echo some pre tags you will see that we have an id time title book description contributor author and all of this so we're going to be looping through each one of these and throwing them inside a table so i'll come back here so now we're going to do a for rich statement and in this for rich we're going to loop through the table info so we need to get table info add it here and then i will say get the table info as info row and so for each info row we are going to get a different piece of information so let me clean this up here i'll paste this down here i'm going to select this all go to the end take away that little bit close off my td and then of course this will be in php so i need to close off my php and then i'm going to go to the very end and then i'm going to write info underscore row then we'll add our arrow to point to each one of those and then of course i have to open php for each one of these for it to work and i will echo so i just need to also put something at the beginning for each one of these so i need to have a td here that will wrap that information around so in here i need to escape php and then i need to open php again here so that my code does not break so i'm going to save this let's come back and see our complete table so come back reload and you're going to see that we have a title book description contributor author and so on and we have a problem here because i've not done this properly i missed one important aspect that for each of those i need to add a table row and close it off so that's why our markup looks funny so i will save that come back reload and when i reload here you'll actually see that we have a title have a book description we have a contributor we have a author price and publisher all of them in the way that we should be having them and this is how we handle calling information from our database onto our front end just like in any other database driven website so if you enjoyed this please let me know in the comments what you're going to use this for or any challenges that you get let me know in the comments so that i can share back with you and also learn from you if you want to put this in a short code i have a video that i've linked inside this video description and you can see how to write your own short code so that you can use this either on a page or in a widget otherwise thank you for watching and enjoy your day