PHP & MySQL
In the first installment of this three-lesson tutorial, our
Kiwi guide covers everything you need to know to begin developing
database hubs. He gives instructions for installation on both
Unix and Windows, and then goes on to show some simple scripts
that will insert information into a database and display that
data on a Web page.
Lesson 2 covers more PHP/MySQL goodies than you could probably
imagine. Graeme starts by showing while loops, then talks about
the ever-useful if-else statement. But this information alone
means little if you don't continue and see how PHP can be used
with HTML forms. By the time you've polished off this lesson,
you'll be able to add, edit, and remove information from your
database.
In Lesson 3, Graeme shows some of the secrets that will turn
your simple data-driven site into a useful application. As he
covers validation, he'll show how to prevent users from leaving
key form fields blank and how to make sure numeric files don't
contain letters. He'll also teach you how PHP handles includes
and functions. Plus you'll see how these two features, when
deployed together, can make the coder's life much easier. Graeme
winds it all up with some tearful parting words and a bit of
advice for the aspiring PHP/MySQL coder.
Other PHP articles:
Creating
Images on the Fly
Encryption
Site
Navigation
Threaded
Discussion with PHP/MySQL
Unless you've been living on Mars for the last six to eight
months, you've heard of open source software (OSS). This movement
has got so much momentum that even the big boys are taking notice.
Companies like Oracle, Informix, and a host of others are releasing
their flagship database products for that poster child of the
OSS movement, Linux.
Having a massively complex RDBMS (relational database management
system) is all well and good if you know what to do with it.
But perhaps you are just getting into the world of databases.
You've read Jay's
article and you want to put up your own data-driven Web
site. But you find you don't have the resources or desire for
an ASP server or some pricey database. You want something free,
and you want it to work with Unix.
Enter PHP and MySQL. These two make up what must be the best
combination for data-driven Web sites on the planet. You needn't
take my word for it. An unofficial Netcraft
survey shows that PHP usage has jumped from 7,500 hosts in June
1998 to 410,000 in March 1999. That's not bad. The combination
was also awarded Database of the Year at Webcon98, where it
received a lovely tiara.
MySQL is a small, compact database server ideal for small -
and not so small - applications. In addition to supporting standard
SQL (ANSI), it compiles on a number of platforms and has multithreading
abilities on Unix servers, which make for great performance.
For non-Unix people, MySQL can be run as a service on Windows
NT and as a normal process in Windows 95/98 machines.
PHP is a server-side scripting language. If you've seen
ASP, you'll be familiar with embedding code within an HTML
page. Like ASP, PHP script is processed by the Web server. After
the server plays with the PHP code, it returns plain old HTML
back to the browser. This kind of interaction allows for some
pretty complex operations.
In addition to being free (MySQL does have some licensing restrictions
though), the PHP-MySQL combination is also cross-platform, which
means you can develop in Windows and serve on a Unix platform.
Also, PHP can be run as an external CGI process, a stand-alone
script interpreter, or an embedded Apache module.
If you're interested, PHP also supports a massive number of
databases, including Informix, Oracle, Sybase, Solid, and PostgreSQL
- as well as the ubiquitous ODBC.
|