All pastes #514194 Raw Edit

Miscellany

public text v1 · immutable
#514194 ·published 2007-05-27 16:29 UTC
rendered paste body
Index: src/shared/Database/SQLStorage.cpp
===================================================================
--- src/shared/Database/SQLStorage.cpp	(revision 3739)
+++ src/shared/Database/SQLStorage.cpp	(working copy)
@@ -77,8 +77,8 @@
     maxi= (*result)[0].GetUInt32()+1;
     delete result;
 
-    result = sDatabase.PQuery("SELECT COUNT(*) FROM `%s`",table);
-
+    result = sDatabase.PQuery("SELECT COUNT(`%s`) FROM `%s`",entry_field,table);
+    
     fields = result->Fetch();
     RecordCount=fields[0].GetUInt32();
     delete result;