function _mysql_fetch_array($result) { $r=0; $c=0; $arr_row[$col -> name] = $row[$col -> name]; $c++; } $table_result[$r] = $arr_row; $r++; } return $table_result; }
która musi działać analogicznie na bazie PostgreSQL:
function _pg_fetch_array($result) { $r=0; $c=0; $col = pg_fetch_field($result, $c); $arr_row[$col -> name] = $row[$col -> name]; $c++; } $table_result[$r] = $arr_row; $r++; } return $table_result; }
niestety w PHP nie ma funkcji pg_fetch_field. W jaki sposób można rozwiązać jej brak? Funkcja _pg_fetch_array($result) musi zwracać tablicę o identycznej strukturze jak funkcja _mysql_fetch_array($result)