PDO::FETCH_ASSOC Question
Posted: Fri Nov 30, 2018 5:04 am
Any ideas as to what else I need to try as I've exhausted my research at the mo ?
Thank you.
Code: Select all
<?PHP $stmt = $pdo->prepare("SELECT * FROM queue ORDER BY customer_name ASC");
$stmt->execute();
$row = $stmt->fetchAll(PDO::FETCH_ASSOC);
if(!$row) exit('No rows');
echo $stmt->rowCount();
//var_export($row);
//$stmt = null;
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
echo $row['date_due'];
echo $row['customer_name'];
}
$results = $stmt->fetchAll(PDO::FETCH_ASSOC);
foreach($results as $row) {
echo $row['date_due'];
echo $row['customer_name'];
} ?>