下面有個方便的解決辦法,從官方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后獲取影響的行數發生異常解決方法,轉載需保留來源!

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

主站蜘蛛池模板: 常德市| 新田县| 大石桥市| 衡东县| 河津市| 察哈| 张北县| 四川省| 含山县| 墨玉县| 广饶县| 行唐县| 泽库县| 平泉县| 庆云县| 新源县| 三门县| 常州市| 壤塘县| 普格县| 海丰县| 郸城县| 仁怀市| 巴林左旗| 荃湾区| 大化| 紫云| 英超| 松滋市| 门源| 沈丘县| 乐亭县| 沈阳市| 久治县| 靖宇县| 南城县| 来安县| 镇坪县| 乌什县| 南木林县| 两当县|