View Single Post
Old 11-15-2012, 11:31 AM   PM User | #1
docock
Regular Coder

 
Join Date: Feb 2007
Posts: 197
Thanks: 21
Thanked 1 Time in 1 Post
docock is an unknown quantity at this point
Question higher number check fails

I'm kinda puzzled by this..

- I retrieve a value of a db field and store it into the variable $numbers.
- I count the number of records in an other database table and store that value in $num_rows.

If the value in $num_rows is higher then $numbers the user gets a warning.

My problem is that the warning is allways displayed even if the value of $num_rows is lower then $numbers.

For example, the coding below displays this:
test mymail@live.nl15max reached.

($num_rows is 1, and $numbers is 5 in this case)

Obviously the higher number check fails, since $num_rows is less then $numbers. How to solve this issue?


Code:
$num_rows = mysql_num_rows($resultaat)+1;

echo $code, $email,$num_rows,$numbers;

if ($num_rows>$numbers){echo "max reached.";exit;}
docock is offline   Reply With Quote