From b3db8de81aa278fd6fce871661c818d521254ef3 Mon Sep 17 00:00:00 2001 From: October Date: Tue, 14 Oct 2014 02:08:17 +0800 Subject: [PATCH] add effect row --- engine/lib/Db.class.php | 3 +++ engine/lib/Mysql.class.php | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/engine/lib/Db.class.php b/engine/lib/Db.class.php index cf7c00a..93be3cc 100644 --- a/engine/lib/Db.class.php +++ b/engine/lib/Db.class.php @@ -91,6 +91,9 @@ class Db{ public function lastId(){ return $this->mysql->lastId(); } + public function affectedRow(){ + return $this->mysql->affectedRow(); + } public function error(){ return $this->mysql->error(); } diff --git a/engine/lib/Mysql.class.php b/engine/lib/Mysql.class.php index 0d8ae50..c49bfa3 100644 --- a/engine/lib/Mysql.class.php +++ b/engine/lib/Mysql.class.php @@ -119,7 +119,9 @@ class Mysql{ unset( $this->dbWrite ); } } - + public function affectedRow(){ + return mysqli_affected_rows( $this->dbWrite ); + } public function escape( $str ){ if( isset($this->dbRead)) $db = $this->dbRead ; elseif( isset($this->dbWrite) ) $db = $this->dbWrite;