I have the following code:
$postId = $_GET[\'postId\'];
$mysqli = new mysqli(\'localhost\', \'username\', \'database\', \'name_db\');
mysqli_report(MYSQLI_RE
As others have stated, it is only available in bleeding edge PHP. You could do something like this (answer to a similar question):
function bind_array($stmt, &$row) {
$md = $stmt->result_metadata();
$params = array();
while($field = $md->fetch_field()) {
$params[] = &$row[$field->name];
}
call_user_func_array(array($stmt, 'bind_result'), $params);
}
// ....
bind_array($stmt, $info);
$stmt->fetch();
echo json_encode($info);
Or use mysqli::query if you have a simple query with no parameters - don't use it with dynamically generated SQL-statements.