Search the blog

If you’ve moved from MySQL to MySQL in PHP, you may be wondering where the MySQLi counterpart of mysql_result is. There isn’t one but instead you can used this simple function. It uses the same parameters as mysql_result.

function mysqliresult($result, $number, $field) {

    mysqli_data_seek($result, $number);
    $row = mysqli_fetch_assoc($result);

    return $row[$field];

Tim Bennett is a Leeds-based web designer from Yorkshire. He has a First Class Honours degree in Computing from Leeds Metropolitan University and currently runs his own one-man web design company, Texelate.