pg_fetch_assoc說明array pg_fetch_assoc ( resource result [, int row] )pg_fetch_assoc() 和呼叫 pg_fetch_array() 加上第三個可選參數 PGSQL_ASSOC 是等價的。它只返回一個關聯陣列。若果需要數字索引,用 pg_fetch_row()。 pg_fetch_assoc() 是 pg_fetch_row() 的增加版本。除了將資料存儲在數字索引(欄位編號)之外,預設還將陣列存儲在關聯索引(欄位名)中。 row 是要被提取的行(記錄)編號。第一行為 0。 pg_fetch_assoc() 並不明顯比 pg_fetch_row() 慢,而且還顯著更便於使用。
參見 pg_fetch_row(),pg_fetch_array(),pg_fetch_object() 和 pg_fetch_result()。 | ||