Forum Moderators: coopster
function checkID($ID) {
$link = open_npc();
$query = "SELECT status
FROM guards
WHERE ID='$ID'";
$result = mysql_query($query);
mysql_close($link);
if ($result['status'] > 0) return ture;
else return false;
} // end function checkID()
When I just return the results it gives me the following: Resource id #2 Error
Some things to check ...
Are you sure you are connecting to the database? Check your $link variable.
Dump the query to the browser to check the validity.
You have "true" spelled incorrectly.
function checkID($ID) {
$link = open_npc();
$query = "SELECT status FROM guards WHERE ID='$ID'";
exit($query); // dump the query to see what's wrong ...
$result = mysql_query($query);
mysql_close($link);
if ($result['status'] > 0) {
return true;
} else {
return false;
}
} // end function checkID()