I am working on fetching data from a table in PHP with the following code. How can I copy all rows directly into an array? I tried fetch_array() instead of fetch() but it was also not successful.
$stmt = $this->db->prepare($sql);
$stmt->execute();
$stmt->bind_result($aID, $sID);
while ($stmt -> fetch()) {
echo $aID . " ". $sID . "<br>";
}