Please shame me. What's not right here? I was hoping for something like ->fetch_all(Opt), a one liner, to place all the results in an array but couldn't make it work. This is what I wound up doing:
$s = "select id, username from users";
$conn = db_connect();
$sth = $conn->prepare($s);
$sth->execute();
$sth->bind_result($id, $un);
$ida = array();
while ($sth->fetch()) {
$ida[] = $id;
}
I tried
$r = $sth->fetch_all()
(tried assigning and not assigning a return value) both using and not using ->bind_result()
but both failed. What am I doing wrong?