课程: PHP with MySQL Essential Training: 1 The Basics

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Retrieve data

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…

内容