I have the following code which executes a MySQL query using prepared statements:
$selectStatement = "SELECT " . implode(", ", $allFields); // cat select w/ allFields
$stmnt = $mysqli->prepare($selectStatement .
"FROM Musicians WHERE name = ?");
$stmnt->bind_param('s', $name);
$stmnt.execute();
At this point, most of what I've read tells me that I should use bind_result()
and then fetch()
on $stmnt. However, I'd prefer to get an array filled with the values instead of iterating over a bunch of dumped variables, as fetch()
does. Is there a way to get something similar to what fetch_assoc()
would give me while using prepared statements and results?