C1D C1D - 1 year ago 74
MySQL Question

Moving to mysqli, mysql_result

I am converting my project from mysql to mysqli and my problem is that

does not work with my old code. My old code is:

When I try adding
with my old code it will not work.

Is there another way that'll work with my old parameters?

Answer Source

mysqli_result() will not work with your old parameters so you need to create a new function, Here is the code for a function that'll work with your old prameters:

function mysqli_result($res, $row, $field=0) { 
    $datarow = $res->fetch_array(); 
    return $datarow[$field]; 
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download