PHP - Get affected rows in ADODB

爷,独闯天下 提交于 2019-12-02 02:28:35

About Affected_Rows(), I don't know why it isn't working. There is another very simple way to get the number of affected rows after execute query.

$conn->Execute($sql,$affected_rows);

echo $affected_rows;

$affected_rows return from Execute function will have value equal to number of affected rows of that query.

just for mark.

your code:

echo $conn->Affected_Rows()

is ADODB SDK methods: http://adodb.org/dokuwiki/doku.php?id=v5:reference:connection:affected_rows

NOT a native COM("ADODB.connection") method.

but i have same problem because this method return "variant Object" so i can't get the value.

i fixed this by edit SDK source file : adodb5/drivers/adodb-ado5.inc.php #44 line:

$this->_affectedRows =new VARIANT;

to:

$this->_affectedRows = null;

then Affected_Rows() method can return a real number for me.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!