Browse Source

patched MyqlResultSet.getLength()

Franco Ponticelli 17 years ago
parent
commit
6e0392520c
1 changed files with 5 additions and 1 deletions
  1. 5 1
      std/php/db/Mysql.hx

+ 5 - 1
std/php/db/Mysql.hx

@@ -87,9 +87,13 @@ private class MysqlResultSet implements ResultSet {
 	}
 	}
 
 
 	private function getLength() {
 	private function getLength() {
+		if(untyped __physeq__(__r, true))
+			return untyped __call__("mysql_affected_rows");
+		else if (untyped __physeq__(__r, false))
+			return 0;
 		return untyped __call__("mysql_num_rows", __r);
 		return untyped __call__("mysql_num_rows", __r);
 	}
 	}
-
+	
 	private var _nfields : Int;
 	private var _nfields : Int;
 	private function getNFields() {
 	private function getNFields() {
 		if(_nfields == null)
 		if(_nfields == null)