Chapter 5

Communicating with the Database from PHP Scripts


check Examining the PHP database libraries

check Connecting to the MySQL server

check Submitting SQL queries

check Retrieving result set data

check 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 live online training, plus books, videos, and digital content from nearly 200 publishers.