I'm trying to get the total number of rows from a query but I'm giving this error, I already tried to use the row (), rowCount () function and even check if I found any results to return and even though I did not get the solution
Fatal error: Call a member function num_rows () on a non-object in C: \ wamp \ www \ topsamp-ci \ application \ models \ model-server.php on line 86
public function getVotosHoje($idServer){
$data = date('Y-m-d');
$select = array('id', 'data');
$where = "idServidor = '$idServer' AND data = '$data'";
$this->db->where($where);
$this->db->select($select);
$retorno = $this->db->get('votos')->result();
if($retorno->num_rows() > 0){
return $retorno->num_rows();
} else{
return false;
}
}