Chapter 4. MySQL and PHP

In This Chapter

  • Building a mailing list form

  • Creating a MySQL database

  • Transferring data to the database

  • Reading data from the database

MySQL and PHP are almost like a marriage made in heaven. PHP likes to send stuff to MySQL, and MySQL accepts it with open arms, er, fields. Like Batman and Robin, MySQL and PHP are a dynamic duo. So dynamic in fact, that quite a few applications out there use the combination to good effect. Blog, bulletin board, and calendar applications are good examples of the dynamic duo at work. You can write a PHP script in a PHP Web page that sends information to and plucks data from a MySQL database. MySQL databases keep the information safely locked away until its good buddy PHP comes calling.

In case you rushed right to this chapter expecting to find out everything you need to know about MySQL and PHP, well, you almost came to the right place. To learn everything about integrating MySQL databases with PHP pages would require a good book. However, in this chapter, on these very pages written with tender loving care, with blisters on your authors' fingers, we show you how to use PHP and MySQL to create a mailing list.

You can choose from a lot of applications for managing mailing lists. The applications enable you to easily manage a mailing list, send information to people who have opted in to the mailing list, and so on. However, if you have a client who doesn't need all the bells and whistles, why give them to him? If your client's only ...

Get Building Web Sites All-in-One Desk Reference 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.