Re: Question for db gurus (was RE: SSI question)
by "Raj Bhaskar" <raj(at)lordofthemoon.com>
|
| Date: |
Tue, 5 Jun 2001 23:28:52 +0100 |
| To: |
hwg-basics(at)mail.hwg.org |
| Cc: |
epeddycoart(at)cg2.com |
| In-Reply-To: |
|
| |
todo: View
Thread,
Original
|
|
> Is using MySQL, which I have available on my web host, a good choice
> for this?
It's been a while since I read the original post, but I remember thinking at
the time that this was a job for a database, so I would say YES. MySQL
is great for doing things like this. It's only when you get into complex
relations and need transactions that it stops being enough.
> Can I use PHP to pull the information from the db.?
Again, YES. PHP has very tight integration with MySQL. There are
several websites that explain how to do this, but I can't remember any of
them offhand. Skeleton code would be something like this:
<?php
$dbConnection= mysql_connect("hostname:port", "username",
"password");
mysql_select_db("databasename");
$query= "select * from tablename where something=somethingelse";
$resultset= mysql_query($query);
while ($row= mysql_fetch_array($resultset)) {
// do stuff here
} // end loop
?>
HTH,
Raj.
--
__ __
| | | | Raj Bhaskar, University of Glasgow
|_ / |_ / E-Mail: raj(at)lordofthemoon.com
| \ | \ Home Page: http://lordofthemoon.com
| \ |__/
There is nothing in the Universe more alone than Man.
He has entered into the strange world of history...
--(Loren Eiseley)
HTML: hwg-basics mailing list archives,
maintained by Webmasters @ IWA
This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.