public function doesUserExist($u) { $this->dbConnect(); mysql_select_db($this->database); $sUser = mysql_real_escape_string($u); $query = \"SEL
You should use the mysql_query before getting the number of rows.
Follow the Link below: http://php.net/manual/en/function.mysql-num-rows.php
For example :
$query = "SELECT username FROM $this->table WHERE username='$sUser'"; $result = mysql_query($query); $num_rows = mysql_num_rows($result);