Chapter 3. Create and Populate a Database: Creating your own data

image with no caption

You don’t always have the data you need.

Sometimes you have to create the data before you can use it. And sometimes you have to create tables to hold that data. And sometimes you have to create the database that holds the data that you need to create before you can use it. Confused? You won’t be. Get ready to learn how to create databases and tables of your very own. And if that isn’t enough, along the way, you’ll build your very first PHP & MySQL application.

The Elvis store is open for business

Elmer Priestley has opened his Elvis store, MakeMeElvis.com. Demand has been huge. He’s sold a number of studded polyester jump suits, many fake sideburns, and hundreds of pairs of sunglasses.

Each time someone buys something, Elmer collects a new email address. He uses these to send out newsletters about sales at his store. Right now Elmer has to manually go through each email address in his list and copy and paste to send out his email advertising sales. It works, but it takes a lot of time and effort.

image with no caption

Elmer spends far too much time copying and pasting emails into the “To” field of his client email application. He wants to simplify the task of adding new email addresses and sending out mass emails.

Elmer needs an application

An

Get Head First PHP & MySQL 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.