下面有個方便的解決辦法,從官方munual上看到 bdobrica at gmail dot com 留言的: As a solution to the problem pointed in the post " /> 久久久久免费,97久久精品人人澡人人爽,波多野结衣在线一区二区

色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

php更新mysql后獲取影響的行數發生異常解決方法

從manual上知道了mysql_affected_rows函數當UPDATE前后的數據一樣時會返回異常值,

下面有個方便的解決辦法,從官方munual上看到 bdobrica at gmail dot com 留言的:
As a solution to the problem pointed in the post reffering to mysql_affected_rows() returning 0 when you are making an update query and the fields are not modified although the query is valid, i'm posting the following function. It is very simple and based on a previous post.
復制代碼 代碼如下:
function mysql_modified_rows () {
$info_str = mysql_info();
$a_rows = mysql_affected_rows();
ereg("Rows matched: ([0-9]*)", $info_str, $r_matched);
return ($a_rows < 1)?($r_matched[1]?$r_matched[1]:0):$a_rows;
}

PS:因為這個小問題折騰了半天,感覺php真是太不清晰了

php技術php更新mysql后獲取影響的行數發生異常解決方法,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 永吉县| 遵义市| 六枝特区| 永嘉县| 新化县| 瑞丽市| 贺兰县| 昔阳县| 惠州市| 老河口市| 武川县| 沈丘县| 丹寨县| 晋城| 荥经县| 西宁市| 文昌市| 张家港市| 崇明县| 八宿县| 延庆县| 花垣县| 甘孜县| 弥勒县| 清原| 阳江市| 宜兰县| 花莲县| 黔江区| 公安县| 上犹县| 恩平市| 迁西县| 大同市| 民和| 新乡市| 福鼎市| 麻栗坡县| 沈阳市| 康保县| 麻城市|