view raw
C1D C1D - 6 months ago 37
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?


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];