Datasheet

15
Chapter 1: Introduction to PHP and MySQL
over the connection. The MySQL server interprets the SQL message and fol-
lows the instructions. The MySQL server sends a return message, stating its
status and what it did (or reporting an error if it was unable to understand or
follow the instructions).
Software designed specifically to interact with MySQL database is also dis-
cussed in this book. You can use this software, called phpMyAdmin, on your
own computer to communicate with your MySQL databases. PhpMyAdmin is
also available on almost all Web hosts.
For the lowdown on how to write and send SQL messages to MySQL, check
out Part II.
PHP, a Data Mover
PHP, a scripting language designed specifically for use on the Web, is your
tool for creating dynamic Web pages. Rich in features that make Web design
and programming easier, PHP is in use on more than 20 million domains
(according to the Netcraft survey at www.php.net/usage.php). Its popular-
ity continues to grow, so it must be fulfilling its function pretty well.
PHP stands for PHP: HyperText Preprocessor. In its early development by a
guy named Rasmus Lerdorf, it was called Personal Home Page tools. When it
developed into a full-blown language, the name was changed to be more in
line with its expanded functionality.
The syntax of the PHP language is similar to the syntax of C, so if you have
experience with C, you’ll be comfortable with PHP. PHP is actually simpler
than C because it doesn’t use some of the more difficult concepts of C. PHP
also doesn’t include the low-level programming capabilities of C because PHP
is designed to program Web sites and doesn’t require the capabilities required
by C.
PHP is particularly strong in its ability to interact with databases. It supports
pretty much every database you’ve ever heard of (and some you haven’t).
PHP handles connecting to the database and communicating with it. You
don’t need to know the technical details for connecting to a database or for
exchanging messages with it. You tell PHP the name of the database and
where it is, and PHP handles the details. It connects to the database, passes
your instructions to the database, and returns the database response to you.
Technical support is available for PHP. You can join one of several e-mail discus-
sion lists offered on the PHP Web site (www.php.net), including a list for data-
bases and PHP. In addition, a Web interface to the discussion lists is available at
http://news.php.net, where you can browse or search the messages.
05_527580-ch01.indd 1505_527580-ch01.indd 15 11/3/09 8:50 PM11/3/09 8:50 PM