So you want to use a database in your site?
June 6, 2000
Jesús Castagnetto
Chances are that at some point in the life of a web site you will need
to be creating content on request. Fortunately (yeah, right...),
I had to tackle this early in the development of our
Metalloprotein Database
site at TSRI.
There are several ways of going about this. You can purchase an expensive
all-in-one packaged solution (with the kitchen sink and all the chrome),
or if you are like me (e.g. someone with not much dough to spend around,
and a taste for tinkering) you will just roll your own. After all kitchen
sinks are overrated and chrome is passe. You will have to invest some
time reading documentation and debugging, but that is the fun part of
it: getting it to work.
What you need
You will need to have a correctly installed web server with PHP support,
and a database. I use Apache with mod_php, and MiniSQL as a back-end
database, but the same will apply if you were using any other server,
with PHP running as a stand-alone CGI and other back-end database engine.
Contents:
Create the Database
Example 1: a simple SQL query interface
Example 2: Parsing and querying
3 Different Types of Variables
Using the Form to Search
Where To Go From Here
So you want to use a database in your site?
Create the Database
|