Learn how to execute an object-oriented query in the project using the database connection and query methods.
- [Narrator] Now that we have a database connection,…let's try executing an object oriented…query over that connection.…So the place that we want to do this is inside that…public bicycles.php page.…You remember that page already lists off the inventory,…and right now it's doing that by parsing a CSV file.…Right, so it's going and getting that CSV, parsing the data…that's in it, and using that to create new bicycles.…Eventually what we want to do is replace that with…our database driven version.…For right now, lets just drop down to…the bottom of the page and after our table,…lets just have another bit of PHP code that's going…to just try and get back values from the database…and then we'll just display them below the table.…
So we'll be doing both for a little while.…We'll be doing the comma separated value parsing…and the database.…And then eventually we can remove other one…when we have this one working.…So the first thing we need to do is we need to…figure out what our SQL is going to look like.…So the SQL is going to be equal to select all…
Note: This is an intermediate-level training course that assumes you have existing knowledge of PHP. To refresh your skills, check out PHP Essential Training and PHP: Object-Oriented Programming.
- Creating a project database and tables
- Connecting to the database
- Database queries with OOP
- The active record design pattern
- Defining a database-driven class
- Performing common database tasks with OOP
- Creating inheritable and reusable code
- Object-oriented user authentication
- Object-oriented pagination
Skill Level Intermediate
Consuming RESTful APIs in PHP with Guzzlewith Justin Yost2h 12m Intermediate
PHP: Accessing Databases with PDO and MySQLiwith David Powers3h 47m Intermediate
1. Overview and Project Setup
2. The Database Connection
3. Define a Database-Driven Class
4. Object-Oriented CRUD
5. Object-Oriented Authentication
6. Object-Oriented Pagination
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.