[Cppcms-users] dbixx and time()
Brought to you by:
artyom-beilis
From: augustin <aug...@ov...> - 2010-10-14 11:55:38
|
Hello, What's the proper way to use Unix timestamps in dbixx queries? I have: dbixx::session sql; // ... time_t t = time(NULL); sql << "SELECT COUNT(*) FROM table WHERE time < ?", t; dbixx::row r; sql.single(r); int count; r >> count; but it won't compile: In file included from main.cpp:3: /usr/local/include/dbixx/dbixx.h: In member function ‘dbixx::session& dbixx::session::operator,(T) [with T = long int]’: main.cpp:170: instantiated from here /usr/local/include/dbixx/dbixx.h:148: error: call of overloaded ‘bind(long int&, bool)’ is ambiguous /usr/local/include/dbixx/dbixx.h:128: note: candidates are: void dbixx::session::bind(const std::string&, bool) <near match> /usr/local/include/dbixx/dbixx.h:129: note: void dbixx::session::bind(const long long int&, bool) /usr/local/include/dbixx/dbixx.h:130: note: void dbixx::session::bind(const long long unsigned int&, bool) /usr/local/include/dbixx/dbixx.h:131: note: void dbixx::session::bind(const int&, bool) /usr/local/include/dbixx/dbixx.h:132: note: void dbixx::session::bind(const unsigned int&, bool) /usr/local/include/dbixx/dbixx.h:133: note: void dbixx::session::bind(const double&, bool) make: *** [learn] Error 1 thanks, Augustin. -- Friends: http://www.reuniting.info/ http://activistsolutions.org/ My projects: http://astralcity.org/ http://3enjeux.overshoot.tv/ http://linux.overshoot.tv/ http://overshoot.tv/ http://charityware.info/ http://masquilier.org/ http://openteacher.info/ http://minguo.info/ http://www.wechange.org/ http://searching911.info/ . |