From the course: PHP with MySQL Essential Training: 1 The Basics
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Retrieve data
From the course: PHP with MySQL Essential Training: 1 The Basics
Retrieve data
- [Instructor] Now that we know how to connect to the database, in this movie, we will learn to retrieve data using the MySQLi API. In the last movie, we talked about the five essential steps for PHP database interaction. And in the last movie, we learned about number one and number five, creating the connection and closing it when we're done. In this movie, we're going to learn about number two and number four, performing a database query, getting back results, and then releasing those results when we're done with them. To query the database, we'll use another MySQLi API function, mysqli_query. It as a companion function, which is mysqli_free_result. mysqli_query is going to accept the first argument, which is the database connection. That's the handle that we created in the last movie. It's how we refer to that open connection. We let it know what connection we want to use to connect to the database. And the second argument then is the query itself. This is the actual SQL code, the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.