IT学习者 -> 技术文档 -> PHP 完全中文手册

函数:ifx_affected_rows()


ifx_affected_rows

得到 Informix 最后操作影响的列数目。

语法: int ifx_affected_rows(int result_id);

返回值: 整数

函数种类: 数据库功能

内容说明

本函数可得到 Informix 最后查询操作 INSERT、UPDATE 或 DELETE 所影响的列 (row) 数目。若最后使用的是 SELECT,则用本函数得到的数目为估计值,而非精确的数目,欲得到 SELECT 返回的数目需使用 ifx_num_rows() 函数。

使用范例

本例为部份程序

<?php
$rid 
ifx_prepare ("select * from userinfo where name like " $name$connid);
if (! 
$rid) {
  
// 错误处理的部份
}
$rowcount ifx_affected_rows ($rid);
if (
$rowcount 1000) {
  
printf ("返回资料太多,共 %d 笔\n<br>"$rowcount);
  die (
"请重新执行 SQL 指令<br>\n");
}
?>

参考

ifx_num_rows()  



[ 上一页  PHP中文手册  下一页 ]

PHP 首页 | PHP 导读 | PHP 函数库 | PHP 函数索引 | PHP 范例程序