![]() So that wasn't too bad, except that WebMatrix didn't have much of this in intellisense and so Google had to hep me out a bit. To make it as simple as possible, I'm just going to be fetching everything and spitting it back out. $databaseConnection->connect_error) Īnd after that I'm ready to start querying some data. $databaseConnection = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME) ĭie("Database selection failed: ". I have the option of using PDO or MySQLi to handle my database work, and because WebMatrix by default uses MySQLi, then I will be using that.Īnd because I'm new to PHP it looks like I'll need to create a new objection of type mysqli to get the job done and I'll need to pass in the appropriate authentication parameters. So I'm going to create a new page and call it BlogPosts.php or something and will use that to fetch all of the blog posts that I have added into my database. Most of the time, with any language pretty much, fetching and adding to a database is one of the things that are required to know and many day to day tasks will revolve around that. I added some fake data into the table and will be displaying it onto a php page. Another thing to note, I can't call a function as a default parameter. ![]() So here is a quick table that will represent the most basic of blog schemas.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |