Seeing zero responses so far, I will try to help.
Unless you have not filled in all the script (?), nothing in your script has you connecting to the database.
Here's what I mean:
$dbconn = mysql_connect("localhost", "username", "password");
$result = mysql_select_db("database_name", $dbconn);
This is taken from the pretty good tutorial here: http://www.newbienetwork.net/content.php?id=3
Then once you've created a connection to the database, you should be able to run the queries from your script.
I'm tired so this may be wrong but I'm sure that if its wrong, someone will straighten it out.
HTH:rolleyes: