PHP ʖ²ἯTH º󍋼/A pg_fetch_object row ʇϫҪȡµõĐУ¨¼ǂ¼£©µı຅¡£µڒ»АΪ 0¡£ =ד 1. Postgres fetch object ?php $database = "verlag"; $db_conn = pg_connect ("host=localhost port=5432 dbname=$database"); if (!$db_conn):? H1 Failed connecting to postgres database ?php echo $database? /H1 ?php exit; endif; $qu = pg_query ($db_conn, "SELECT * FROM verlag ORDER BY autor"); $row = 0; // postgres needs a row counter other dbs might not while ($data = pg_fetch_object ($qu, $row)) {echo $data- autor." ("; echo $data- jahr ."): "; echo $data- titel." BR "; $row++;}? PRE ?php $fields[] = Array ("autor", "Author"); $fields[] = Array ("jahr", "Year"); $fields[] = Array ("titel"," Title"); $row= 0; // postgres needs a row counter other dbs might not while ($data = pg_fetch_object ($qu, $row)) {echo "----------\n"; reset ($fields); while (list (,$item) = each ($fields)): echo $item[1].": ".$data- $item[0]."\n"; endwhile; $row++;} echo "----------\n";? /PRE ?php pg_free_result ($qu); pg_close ($db_conn);? º󍋼/A ưµ㼯A pg_fetch_assoc ɏһ¼¶ pg_fetch_result