This function accounts for the ability of the original function to accept "table_name.field_name" entries as well as just the field name:
function mysqli_result($res, $row, $field=0) {
$result->data_seek($row);
$data = $result->fetch_array();
$field_name = $field;
if ( is_string($field) ) {
$fields_array = explode(".", $field);
$array_len = count($fields_array);
if ($array_len > 1) {
$field_name = $fields_array[array_len - 1];
} else {
$field_name = $fields_array[0];
}
}
return $data[$field_name];
}