This is my code... if I uncomment the one line where it declares the variable $clan, then I enter an ID that does not exist in the database, I get a blank page, however, if I comment that line, and enter an ID that doesnt exist, I get the normal error. What would declaring a variable have to do with showing an else line?
This is my code:
<?
if (isset($_REQUEST['id']) && $_REQUEST['id'] != '')
{
$id = $_REQUEST['id'];
require('config.php');
mysql_connect ($hostname, $db_login, $db_pass) or exit(mysql_error());
mysql_select_db($database) or exit(mysql_error());
$select_clan = "SELECT * FROM clans WHERE clan_id = '$id'";
$verc = mysql_query($select_clan) or exit(mysql_error());
//$clan = mysql_fetch_array ($verc) or die (mysql_error());
if (mysql_num_rows($verc)) {
echo 'This clan was found in our database.';
}
else {
echo 'This clan was not found in our database!';
}
}
else
{
echo 'missing or empty id';
}
?>