From 8f30c6dd235bdafb9722daf90c0bc38852a1b2b5 Mon Sep 17 00:00:00 2001 From: pixel Date: Mon, 13 Aug 2007 16:02:33 +0000 Subject: Fixing 'insertid' and 'affectedrows' results. --- lib/SQL.cc | 8 +++----- 1 file 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; } -- cgit v1.2.3