Roze
May 19th 2005, 4:48 am
Hello, I know this will be really simple for most of you, if you have a second I'd appreciate some help.
I'm working hard to take my site out of Nuke, because it's SLOW...but I'm having a hard time talking to the database. I programmed some basic modules for my site, learning all the way, but I can only talk to the db using "nuke" language. In the example below, I'm trying to print out a simple list, can anyone tell me why it isn't working? Sorry if this is so basic..do I need to define more functions before i can use this syntax?
Username and password changed.
$username = "user";
$password = "password";
$hostname = "localhost";
$dbh = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
print "Connected to MySQL<br>";
$selected = mysql_select_db("nuke1",$dbh)
or die("Could not select nuke1");
$result = mysql_query("SELECT gid, groupname FROM nuke_catalog_groups order by description");
while (list ($gid, $groupname) = mysql_fetch_row($result, $dbh)) {
echo "<a href=\"modules.php?name=Archives&op=group&gid=$gid\">$groupname</a><br>";
}
I'm working hard to take my site out of Nuke, because it's SLOW...but I'm having a hard time talking to the database. I programmed some basic modules for my site, learning all the way, but I can only talk to the db using "nuke" language. In the example below, I'm trying to print out a simple list, can anyone tell me why it isn't working? Sorry if this is so basic..do I need to define more functions before i can use this syntax?
Username and password changed.
$username = "user";
$password = "password";
$hostname = "localhost";
$dbh = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
print "Connected to MySQL<br>";
$selected = mysql_select_db("nuke1",$dbh)
or die("Could not select nuke1");
$result = mysql_query("SELECT gid, groupname FROM nuke_catalog_groups order by description");
while (list ($gid, $groupname) = mysql_fetch_row($result, $dbh)) {
echo "<a href=\"modules.php?name=Archives&op=group&gid=$gid\">$groupname</a><br>";
}