Having a problem with a MySQL query, and the problem is mysql_error() isn't returning anything. So I don't know whats wrong, other than the fact that $result = false/null...
I've simplified the code down to what is causing the problem (ie this is part of a larger script, but on its own it doesn't work either):
<?
include ("../connect.php");
sql_connect();
sql_accessdb();
$query = "SELECT gid, guildname, guildtype, leader, lemail, repname, repemail FROM guilds";
$result = @mysql_query($query);
if ($result) {
echo "Database Error: " .mysql_error();
exit();
}
while ($row = mysql_fetch_array($result)) {
print $row['guildname'];
}
?>
Can anyone see a problem in any of the above?
Cheers,