This is probably happening because you have no open mysql connection. you must first have an open connection for mysql_real_escape_string()
to work.
mysql_connect('mysql_host', 'mysql_user', 'mysql_password') // open connection..
$searchGenre = mysql_real_escape_string($this->piVars[searchGenre]); // use it
Note: mysql_
functions are deprecated. Use prepared statements with PDO (or mysqli) instead.