From the course: PHP: Object-Oriented Programming with Databases

Unlock the full course today

Join today to access over 24,100 courses taught by industry experts.

Query using OOP

Query using OOP

- [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…

Contents