summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpixel <pixel>2007-08-13 16:02:33 +0000
committerpixel <pixel>2007-08-13 16:02:33 +0000
commit8f30c6dd235bdafb9722daf90c0bc38852a1b2b5 (patch)
tree2c544ddce4978d50883aa8eeb3eb5e2add00f60b
parentd8be7311dd265538d8ce0b73edef4c27b870ebfa (diff)
Fixing 'insertid' and 'affectedrows' results.
-rw-r--r--lib/SQL.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/SQL.cc b/lib/SQL.cc
index 4bfcdc0..7e2050d 100644
--- a/lib/SQL.cc
+++ b/lib/SQL.cc
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: SQL.cc,v 1.15 2007-06-19 13:39:34 pixel Exp $ */
+/* $Id: SQL.cc,v 1.16 2007-08-13 16:02:33 pixel Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -72,15 +72,13 @@ int SQLConnection::query(const String & q) {
nr = mysql_num_rows(res);
nf = mysql_num_fields(res);
fields = mysql_fetch_fields(res);
- na = mysql_affected_rows(con);
- ii = mysql_insert_id(con);
} else {
nr = 0;
nf = 0;
fields = 0;
- na = 0;
- ii = -1;
}
+ na = mysql_affected_rows(con);
+ ii = mysql_insert_id(con);
return r;
}