I'm trying to get the number of rows from a Select
to show some messages to the user or not, but all possible attempts did not return the correct result.
What I'm using is a William Francisco Leite class that caters me perfectly, but I can not get the total of rows as desired.
What I have is this:
// CONEXÃO PDO $pdo = Conexao::getInstance(); $crud = Crud::getInstance($pdo, 'cadDolar');
The search code:
$sqlMaxDolar = "SELECT DATE_FORMAT(MAX(Data),'%Y-%m-%d') as DataDolar FROM cadDolar"; $arrayParam = array(); $ResMaxDolar = $crud->getSQLGeneric($sqlMaxDolar, $arrayParam, TRUE); $QtdeMaxDolar = count($ResMaxDolar);
As suggested:
print_r($ResMaxDolar); Resultado: Array ( )
The result of this query should be 1 but it is returning 0.
I have tried with rowCount
, but the manual itself says it is not trustworthy to use.