I dont have mysqlnd available, so i implemented a helper function to do the job:
public function bind_array($stmt, &$row) {
$md = $stmt->result_metadata();
var_dump($md);
$params = array();
while($field = $md->fetch_field())
{
$params[] = &$row[$field->name];
}
call_user_func_array(array($stmt, 'bind_result'), $params);
}
The trouble is, that i also need it to be able to return multiple rows. As of now it can only return a single row.
Thanks....
EDIT: What im aiming for is getting the same result as when calling mysqli fetch_assoc, which is not available for me, as i dont have mysqlnd... The array will afterwards be json_encoded ..
in fact, PDO is WAY easier than mysqli with mysqlnd.
You can try my wrapper for PDO which can make it even better than original class - it's incredible simple in use, combining simplicity of old mysql functions with power and safety of prepared statements.
Say, to get your multiple results you wull need one single line of code, opposite to several screens in case of mysqli or half-dozen when using old mysql functions:
now $data contains the desired result you can iterate over
Just define four constants with your DB credentials somewhere and then you'll be able to use database anywhere in your code, just like with old mysql ext used to be.