MySQLi fetch as array
ANSWER: It turns out I had to install mysqlnd
via sudo apt-get install php5-mysqlnd
.
I am using PHP and mysqli. How do I get data from my database as an array? I am currently doing this, but I want it to be like an array:
$stmt = $cxn->prepare('SELECT username, display_name, registered_on, ip_address FROM users WHERE user_id = ?');
$stmt->bind_param('i', $userid);
$stmt->execute();
$stmt->bind_result($username, $display_name, $registered_on, $ip_address);
$stmt->fetch();
$stmt->close();
thank
+3
user3866797
source
to share