PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  
<PostgreSQLpg_cancel_query>
Last updated: Mon, 16 Jul 2012

pg_affected_rows

(PHP 4 >= 4.2.0, PHP 5)

pg_affected_rows -- 返回受影响的记录数目

说明

int pg_affected_rows ( resource result )

pg_affected_rows() 返回在 pg_query() 中执行 INSERT,UPDATE 和 DELETE 查询后受到影响的记录数目(包括实例/记录/行)。如果本函数没有影响到任何记录,则返回 0。

例子 1. pg_affected_rows() 例子

<?php
$result
= pg_query($conn, "INSERT INTO authors VALUES ('Orwell', 2002, 'Animal Farm')");
$cmdtuples = pg_affected_rows($result);
echo
$cmdtuples . " tuples are affected.\n";
?>

注: 本函数以前被称为 pg_cmdtuples()

参见 pg_query()pg_num_rows()




<PostgreSQLpg_cancel_query>
 Last updated: Mon, 16 Jul 2012
 
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://manual.phpv.net/
Last updated: Thu Jul 7 19:13:47 2005 CST