Chapter 17. Interacting with MySQL Using PHP

Now that you’ve learned the basics of the PHP as well as the basics of working with MySQL, you’re ready to make the two interact. Think of PHP as a conduit to MySQL—the commands you learned in the previous chapter are the same commands that you will send to MySQL in this chapter, only this time you’ll send them with PHP. In this chapter, you will learn

  • How to connect to MySQL using PHP

  • How to insert and select data through PHP scripts

Connecting to MySQL with PHP

To successfully use the PHP functions to talk to MySQL, you must have MySQL running at a location to which your Web server can connect (not necessarily the same machine as your Web server). You also must have created a user (with a password), and ...

Get Sams Teach Yourself PHP, MySQL® and Apache All in One, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.