[Solved] Why mysql_num_row less than condition doesn’t work?


Use this:

<?php
$sql=mysql_query("SELECT ID FROM emp WHERE user="$login_session""); // its currently zero
$row=mysql_num_rows($sql);
$b = 3;
$tot=$b - $row;
echo "$tot"; 

if($row < $b) {
echo "good";
} else { echo "wrong"; }
?>

You have been trying to output variables, which is not defined.

You code was:

Ouput undefined variables
Assign something to this variables

In my code order is:

Assign something to this variables
Ouput undefined variables

1

solved Why mysql_num_row less than condition doesn’t work?