OSDN Git Service

CHANGE:MysqlPDO::exec()の返り値をPDO::exec()に近づけた。
[nucleus-jp/nucleus-next.git] / nucleus / libs / sql / MYSQLPDO.php
index f672b4b..93e7e22 100644 (file)
@@ -269,8 +269,17 @@ class MysqlPDO
 \r
        public function exec($statement)\r
        {\r
-               @call_user_func(MysqlPDO::$handler . 'query', $statement, $this->dbcon);\r
-               return @call_user_func(MysqlPDO::$handler . 'affected_rows', $this->dbcon);\r
+               $result = @call_user_func(MysqlPDO::$handler . 'query', $statement, $this->dbcon);\r
+               if ( $result === FALSE )\r
+               {\r
+                       return FALSE;\r
+               }\r
+               $ret = @call_user_func(MysqlPDO::$handler . 'affected_rows', $this->dbcon);\r
+               if ( $ret > -1 )\r
+               {\r
+                       return $ret;\r
+               }\r
+               return;\r
        }\r
 \r
        public function getAttribute($attribute)\r