I have to loop through an object called $logs
in order to display queried data. I would also like to loop through an array of numbers I’ve created in order to have them line up next to each row of queried data. From my code I get an array to string conversion error. Does anyone know why this is happening?
$sql1 = "SELECT * FROM client_table GROUP BY client_name";
$query = $this->db->prepare($sql1);
$query->execute();
$logs = $query->fetchAll();
$totals = array($darty, $doug, $eliott, $henry, $leo, $neo, $rforgo, $sample,
$susanne, $tim);
foreach ($logs as $log) {
echo date("Y m-d ");
echo "2nd half ";
echo $log->client_name . " ";
$totals . "\n" ;
}