下面有個方便的解決辦法,從官方munual上看到 bdobrica at gmail dot com 留言的: As a solution to the problem pointed in the post " /> 久久人体大胆视频,懂色av一区,国产精品一区二区欧美

色尼玛亚洲综合影院,亚洲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后獲取影響的行數發生異常解決方法,轉載需保留來源!

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

主站蜘蛛池模板: 巴塘县| 兴仁县| 连云港市| 武夷山市| 舟山市| 东阳市| 鄱阳县| 任丘市| 澳门| 蓬莱市| 天水市| 涞水县| 五峰| 信阳市| 巴林右旗| 黄大仙区| 手游| 浙江省| 兖州市| 眉山市| 永济市| 前郭尔| 商都县| 谢通门县| 尼玛县| 和龙市| 大新县| 永靖县| 铁岭县| 松桃| 黄龙县| 铁力市| 阳东县| 关岭| 耿马| 新巴尔虎右旗| 临泽县| 棋牌| 新余市| 伊通| 云龙县|