Somehow, my code is executing both the if and the else code!
$q = "SELECT id FROM ".TBL_VOTECOUNT." WHERE voteid = '$mainid' AND voterid = '$_SESSION[id]'";
$result = $database->query($q);
if (mysql_num_rows($result) > 0) {
}
else {
}
The code for $database->query is
function query($query){
return mysql_query($query, $this->connection);
}
Is there any reason why this code should run both the if and else blocks?
How can you tell that it is executing both? The code itself does not seem to have a problem.
I suggest trying the following
Do you get a happy face, an unhappy face or both?