Part I
Developing a Web Database Application Using PHP and MySQL
In this part . . .
In this part, I provide an overview. I describe PHP and MySQL, how each one works, and how they work together to make your Web database application possible. After describing your tools, I show you how to set up your working environment. I present your options for accessing PHP and MySQL and point out what to look for in each environment.
After describing your tools and your options for your development environment, I provide an overview of the development process. I discuss planning, design, and building your application.
Chapter 1
Introduction to PHP and MySQL
In This Chapter
Finding out what a Web database application is
Discovering how MySQL works
Taking a look at PHP
Finding out how PHP and MySQL work together
So you need to develop an interactive Web site. Perhaps your boss just put you in charge of the companyâs online product catalog. Or you want to develop your own Web business. Or your sister wants to sell her paintings online. Or you volunteered to put up a Web site open only to members of your circus acrobatsâ association. Whatever your motivation might be, you can see that the application needs to store information (such as information about products or member passwords), thus requiring a database. You can see also that the application needs to interact dynamically with the user; for instance, the user selects a product to view or enters membership information. This type of Web site is a Web database application.
I assume that youâve created static Web pages before, using HTML (HyperText Markup Language), but creating an interactive Web site is a new challenge, as is designing a database. You asked three computer gurus you know what you should do. They said a lot of things you didnât understand, but among the technical jargon, you heard âquickâ and âeasy,â and âfreeâ mentioned in the same sentence as PHP and MySQL. Now you want to know more about using PHP and MySQL to develop the Web site that you need.
PHP and MySQL work together very well; itâs a dynamic partnership. In this chapter, you find out the advantages of each, how each one works, and how they work together to produce a dynamic Web database application.
What Is a Web Database Application?
An application is a program or a group of programs designed for use by an end user (for example, customers, members, or circus acrobats). If the end user interacts with the application via a Web browser, the application is a Web based or Web application. If the Web application requires the long-term storage of information using a database, itâs a Web database application. This book provides you with the information that you need to develop a Web database application that can be accessed with Web browsers such as Internet Explorer and Firefox.
A Web database application is designed to help a user accomplish a task. It can be a simple application that displays information in a browser window (for example, current job openings when the user selects a job title) or a complicated program with extended functionality (for example, the book-ordering application at Amazon.com or the bidding application at eBay).
A Web database application consists of just two pieces:
Database: The database is the long-term memory of your Web database application. The application canât fulfill its purpose without the database. However, the database alone is not enough.
Application: The application piece is the program or group of programs that performs the tasks. Programs create the display that the user sees in the browser window; they make your application interactive by accepting and processing information that the user types in the browser window; and they store information in the database and get information out of the database. (The database is useless unless you can move data in and out.)
The Web pages that youâve previously created with HTML alone are static, meaning the user canât interact with the Web page. All users see the same Web page. Dynamic Web pages, on the other hand, allow the user to interact with the Web page. Different users might see different Web pages. For instance, one user looking...