Re: [Cppcms-users] Bizarre prepared statement problem
Brought to you by:
artyom-beilis
From: Marcel H. <ke...@co...> - 2012-05-21 07:29:52
|
Am 21.05.2012 06:52, schrieb ele...@ex...: > UPDATE: > > Something even stranger. If I replace all the hardcoded times and run it > through a prepared statement > > This works(always returns 2 rows) > > r = sql<< os.str() > << "2012-05-17 23:59:59" > << "2012-05-17 23:59:59" > << aircraft_id; > > but this doesnt(returns sometimes 1, sometimes 2 rows): > > string ts = "2012-05-17 23:59:59"; > > r = sql<< os.str() > << ts > << ts > << aircraft_id; > > What the hell is going on here? strange strange. I don't really know if this could help, but: ts is a string and you give two times the same string into the preparedstatement. You could try to copy ts to ts2 (string ts2=ts) and try that again with << ts << ts2. And then if that helps, that would be strange though ;) Find out what's going on there ! ^^ Regards |