Datasheet
10
Part I: Developing a Web Database Application Using PHP and MySQL
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 data-
base 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 data-
base. 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 inter-
act with the Web page. Different users might see different Web pages. For
instance, one user looking at a furniture store’s online product catalog might
choose to view information about the sofas, whereas another user might
choose to view information about coffee tables. To create dynamic Web
pages, you must use another language in addition to HTML.
One language widely used to make Web pages dynamic is JavaScript.
JavaScript is useful for several purposes, such as mouse-overs (for example,
to highlight a navigation button when the user moves the mouse pointer over
it) or accepting and validating information that users type into a Web form.
However, it’s not useful for interacting with a database. You wouldn’t use
JavaScript to move the information from the Web form into a database. PHP,
however, is a language particularly well suited to interacting with databases.
PHP can accept and validate the information that users type into a Web form
and can also move the information into a database. The programs in this
book are written with PHP.
05_527580-ch01.indd 1005_527580-ch01.indd 10 11/3/09 8:50 PM11/3/09 8:50 PM