From f7b04e5d93dcbd158f117da3e5821742a74e3f38 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 30 Apr 2006 21:59:38 +0000 Subject: change to ability for QueryCount to return -1 for both of the 1.1 sql api's git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3921 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_sql.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/modules/extra/m_sql.h b/src/modules/extra/m_sql.h index e1a8b0efd..49782b9b4 100644 --- a/src/modules/extra/m_sql.h +++ b/src/modules/extra/m_sql.h @@ -69,10 +69,11 @@ class SQLResult { protected: int resptype; - unsigned long count; + long count; std::string error; std::map row; public: + void SetRow(std::map r) { row = r; @@ -105,12 +106,13 @@ class SQLResult return error; } - void SetCount(unsigned long c) + void SetCount(long c) { count = c; } - unsigned long GetCount() + /* This will return a negative value of the SQL server is down */ + long GetCount() { return count; } @@ -199,7 +201,7 @@ class SQLQuery return rowresult->GetField(fname); } - int GetCount() + long GetCount() { rowresult = (SQLResult*)rowquery->Send(); if (rowresult->GetType() == SQL_COUNT) -- cgit v1.2.3