Chapter 5
Communicating with the Database from PHP Scripts
IN THIS CHAPTER
Examining the PHP database libraries
Connecting to the MySQL server
Submitting SQL queries
Retrieving result set data
Exploring a PHP database application
In the previous chapter, I show you how to insert, delete, and manage data in a MySQL database. Now that you have your content all ready for your application, there’s just one more piece to add in the assembly line to complete your dynamic web applications. This chapter explores how you can interact with the MySQL database server from your PHP programs to retrieve the stored data, add new data records, and remove existing data records. This chapter first explores how PHP interacts with databases in general. Then it focuses on the most popular method used for accessing MySQL databases from web applications: the mysqli library.
Database Support in PHP
The PHP programming language doesn't have any functions for accessing databases directly built into the language. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access