PHP完全中文操作手冊

天地JPLOP | PHP首頁 | 函數索引
函數:pg_Fetch_Array()

pg_Fetch_Array

返回數組資料。

語法: array pg_fetch_array(int result, int row);

返回值: 數組

函數種類: 數據庫功能

內容說明

本函數用來將查詢結果 result 拆到數組變量中。若 result 沒有資料,則返回 false 值。參數 result 為使用 pg_Exec() 所返回的代碼值。參數 row 為列數。

使用範例

<?php
$conn
= pg_pconnect("","","","","publisher");
if (!
$conn) {
echo
"錯誤, 無法連接\n";
exit;
}
$result = pg_Exec($conn, "SELECT * FROM authors");
if (!
$result) {
echo
"錯誤, 無法查詢\n";
exit;
}
$arr = pg_fetch_array($result, 0);
echo
$arr[0]." <- array\n";
$arr = pg_fetch_array ($result, 1);
echo
$arr["author"] . " <- array\n";
?>



整理: 夕垌菪姬 (天地JPLOP)

[ 上一頁 回主目錄 下一頁 ]
版權所有,天地JPLOP、爵堤亞(夕垌菪姬)。網頁背景音樂和各鍊結標題
及鍊結內容和文章小說,版面編排皆歸原權利人所有對本版面
有任何意見或指教,歡迎至論壇指教。