[eluser]TunaMaxx[/eluser]
@PhilTem's answer is
right way to do it.
However, for your reference, the problem with your code is that you're trying to return based on the result of the condition. You need to return, and then alter the value based on the condition, like so:
Code:
return ($q->num_rows() > 0) ? TRUE : FALSE;
But don't do it this way, use @PhilTem's example code!