Oracle's 8 Scott.Emplyoee like DBMS with POstgreSQL
Uses pg_num_fields($result); and pg_fetch_result($result, $row, $y)
"; $result = pg_query($dbconn, "SELECT * FROM emp ORDER BY ename"); if ($result) { echo "The query executed successfully.
\n"; // show name of the fields $i = pg_num_fields($result); echo" "; for ($j = 0; $j < $i; $j++) { echo ""; } echo "
"; $fieldname = pg_field_name($result, $j); echo $fieldname."
"; // echo"
"; echo" "; // for ($row = 0; $row < pg_num_rows($result); $row++) { //embbedding for loop echo ""; for($y=0; $y < pg_num_fields($result) ; $y++) { $r2 = pg_fetch_result($result, $row, $y); echo " "; } // nested for echo ""; } echo "
".$r2."
"; } else { echo "The query failed with the following error:
\n"; echo pg_last_error($db_handle); } pg_close($dbconn); ?>