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. ...
Get PHP, MySQL, & JavaScript All-in-One For Dummies now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.