Alright I can not figure this one out, so I'm guessing it's some simple typo and some extra eyes will help me spot it.
Here's the query (already connected to DB everything works in that respect):
[php]$inactiveQuery = "SELECT userid,email_address,username,signup_date FROM users WHERE activated = 0";
$inactiveResult = mysql_query($inactiveQuery) or die('error: query failed: '.mysql_error());
$inactiveNumRows = mysql_num_rows($inactiveResult) or die('error: num_rows failed: '.mysql_error());
if($inactiveNumRows==0) {
echo "No inactive users!";
} else {
echo "Found users!";
}[/php]
Alright so this always gives an error on mysql_num_rows; it simply says, "Error: num_rows failed: ", but doesn't give me anymore than what I asked it to there; no official error or anything. I have at least one user in my table with activated = 0; everyone else is '2' (0=inactive, 1=reminded to activate, 2=active).
I have tried this with 2 as well, and get the same result.
I tried changing the select to say "WHERE user_level = 0", and it worked fine. Is activated some sort of reserved word? What am I doing wrong?
Thanks in advance!