I know that $stmt->fetchAll(PDO::FETCH_ASSOC); returns the result in an array to the variable, but how would you go around extracting the information from the array? Say the variable holds 3000 entries.
Thank you
If you mean extract information from what $stmt->fetchAll(PDO::FETCH_ASSOC); returns, you need to set it to a variable.
$returned_results = $stmt->fetchAll(PDO::FETCH_ASSOC);
foreach($returned_results as $key=>$result) {
echo "<pre>"; var_dump($result); echo "</pre>";
}
This will dump every result, which will show you how to directly access the array hierarchy.
Which will end up being something like:
$returned_results[2]['somefield'];
$hello[0]["id"];foreach($hello as $row){ echo $row["id"]; }