1.1 What this tutorial will show you
This tutorial is intended to quickly bring you up to speed on
connecting to the MySQL database using as PHP as the Web front end.
It will have multiple examples of selects in their myirad forms. I'll
also go over Inserts, Updates and Deletes.
1.2 What you should already know
This tutorial is NOT intended to teach you SQL or the
internals of PHP. You should already know how to create tables and
write the SQL queries manually. PHP is very easy to learn. If you
have any scripting experience, picking up yet another scripting
language will not be a problem.
1.3 Other useful tutorials
A good tutorial on the basics of SQL can be found at:
At some point, I need to poke around and find if there are any
decent tutorials for PHP. A good place to start looking is the
PHP home pages of course.
1.4 Why PHP instead of Perl & DBI
PHP is a wonderful scripting language for creating HTML pages on
the fly. Dynamic information can be pulled from many sources (such as
databases) and passed along to the user. It is easy to learn and
handles the vast majority of the tasks you'll ever need to do with
Perl on the other hand is a scripting masterpiece. It can do darn
near anything and when you include the database independance modules
(DBI), it becomes a powerful development tool for enterprise systems.
However that power comes at a cost, namely complexity. If you write a
system which can handle anything, then that system has to allow
anything. This often results in cryptic additional arguments to
routines which you don't know why they exist. Even if you do know,
odds are you're not in the small percentage of folks who actually
So for the vast majority of my work, I use PHP. It's simpler and
faster to develop in. When I run across situations that it can't
handle, I then turn to Perl and it's greater complexity.
Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/astute/www/html/template.php on line 198