I have a query like this:
$stmt = $cxn->prepare('SELECT post_id, user_id, content, datetime, total_comments, total_likes FROM posts WHERE user_id = ?');
$stmt->bind_param('i', $user_id);
$stmt->execute();
$stmt->bind_result($post_id, $user_id, $content, $datetime, $total_comments, $total_likes);
$stmt->fetch();
$stmt->close();
I'd like to instead just have the results put directly into an array. How can I change my code to reflect that (PHP and MySQLi)?
Thanks.