Hello,
Maybe I'm being a little stupid, but it has been a long year already!
We're trying to migrate from mysql to oracle and it is going fairly smoothly except for one important function: mysql_fetch_array
PHP has no real exact oracle equivalent so I wrote this to deliver precisely the same result:
function fetchArray ($stmt)
{
$i = 1;
while(OCIFetchinto($stmt,$row,OCI_ASSOC))
{
$j = 0;
while(list($col, $val) = each($row))
{
$array[$i][$j] = $val;
$array[$i][$col] = $val;
$j++;
}
$i++;
}
return $array;
}
The problem is how to functionise this so that when calling this function by doing something like:
while ($row = fetchArray($resource_id)){
echo "<br>\n do stuff to each row";
}
...it acts in exactly the same way as mysql did. I think the problem is the absence of some pointer or index that tells the oracle function what row to grab next.
Do you understand this problem, if so do you know how to solve it please?
Many thanks,
Jason
p.s. I'm already using metabase - but this function doesn't seem to exist in there for oracle.