具有多个参数的mysqli get_result替代方案

SELECT * FROM `ware_house_indents` WHERE `has_cancel` = ? AND `eid`= ? 

i need to get result above query in mysqli. but i cant use get_result() function because it is not working in server.i have found this below function and it is working fine.but that function not possible to pass multiple parameters.please help me to solve this problem.

function db_bind_array($stmt, &$row)
{
    $md = $stmt->result_metadata();
    $params = array();
    while($field = $md->fetch_field()) {
        $params[] = &$row[$field->name];
    }
    return call_user_func_array(array($stmt, 'bind_result'), $params);
}
function db_query($db, $query, $types, $params)
{
    $stmt = $db->prepare($query);
    $bindRet = call_user_func_array(array($stmt,'bind_param'),
                                    array_merge(array($types), $params));
    $stmt->execute();
    $result = array();
    if (db_bind_array($stmt, $result) !== FALSE) {
        return array($stmt, $result);
    }
    $stmt->close();
    return FALSE;
}
if (($qryRes = db_query($mysqli, $sql, 'i', array(&$var))) !== FALSE) {
    $stmt = $qryRes[0];
    $row = $qryRes[1];
    while ($stmt->fetch()) {
        print_r($row);
    }
    $stmt->close();
}

Let me suggest you a quite indirect solution.
You'd do yourself a huge favor if start using PDO instead of mysqli

It has no mysqli disadvantages when dealing with prepared statements as it has a way better implementation of above functions out of the box. So, it will let you to get your data in a few lines:

$sql = "SELECT * FROM ware_house_indents WHERE has_cancel = ? AND eid= ?";
$stm = $pdo->prepare($sql);
$stm->execute(array($cancel,$eid));
$data = $stm->fetchAll(); // or fetch() if you need only one row

that's all