diff options
-rw-r--r-- | server/src/database.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/server/src/database.cc b/server/src/database.cc index d5221f4..9cdbb7f 100644 --- a/server/src/database.cc +++ b/server/src/database.cc @@ -167,10 +167,14 @@ Values Database::getValues(std::string cpr, first = false; i++; } - query << ")"; + if(fields.size() > 0) query << ")"; query << " ORDER BY transactions.timestamp"; +#ifdef WITH_DEBUG + printf("%s\n", query.str().c_str()); +#endif/*WITH_DEBUG*/ + #ifndef WITHOUT_DB pqxx::result R = W.exec(query.str()); @@ -191,10 +195,6 @@ Values Database::getValues(std::string cpr, ri++; } #endif/*WITHOUT_DB*/ - -#ifdef WITH_DEBUG - printf("%s\n", query.str().c_str()); -#endif/*WITH_DEBUG*/ return values; } |