si ma come lo aggiungo all'array finale di cui viene fatto il json_encode??
per ora ho fatto così, ma non mi sembra granchè come soluzione:
Codice PHP:
$totale = 0;
$queryTotArticoli = $obj->getCount('');
while ($row = $queryTotArticoli->fetch(PDO::FETCH_ASSOC)) {
extract($row);
$totale = $cnt;
}
$resArray = array(
"totale" => $totale,
);
$resArray["articoli"] = array();
.........
echo json_encode($resArray);