I have a problem with my code and I don't understand where is, So my code is :
public function getCurrentCycle()
{
$cycle = NULL;
$sql="SELECT * FROM " . Test::TABLE_NAME . " WHERE NOW() BETWEEN begin_date AND finish_date LIMIT 1";
$res = PzfMysql :: query($sql, $this->dbconnection);
if(mysql_num_rows($res) == 1)
{
$cycle = PzfMysql::fetch_object($res, 'Test');
}
return $cycle;
}
I verified $this->dbconnection is set = name of connection,$res it's retourn Resource id #11 but I get an error:
ERROR : 2, mysql_num_rows() expects parameter 1 to be resource, null
Help me please, Thx in advance