pg_Fetch_Row
返回单列的各字段。
语法: array pg_fetch_row(int result, int row);
返回值: 数组
函数种类: 数据库功能
内容说明
本函数用来将查询结果 result 之单列拆到数组变量中。数组的索引是数字索引,第一个的索引值是 0。若 result 没有资料,则返回 false 值。参数 row 表列数。
使用范例
?php
$conn = pg_pconnect("","","","","publisher");
if (!$conn) {
echo "连接失败n";
exit;
}
$result = pg_Exec($conn, "SELECt * FROM authors");
if (!$result) {
echo "查询失败n";
exit;
}
$row = pg_fetch_row($result, 0);
echo $row[0] . " - rown";
$row = pg_fetch_row($result, 1);
echo $row[0] . " - rown";
$row = pg_fetch_row($result, 2);
echo $row[1] . " - rown";
?
参考
pg_Fetch_Array() pg_Fetch_Object() pg_Result()
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)