   [SOLVED]Could use some help with mysql++ if anyones used it before
  I have this functionbool CheckLoginDetails(CPacket *loginPacket, ENetPeer *TPeer){string username(loginPacket->ReadString());string password(loginPacket->ReadString());string queryCommand("SELECT * FROM login WHERE username = ");queryCommand.append(username);queryCommand.append(" AND password = ");queryCommand.append(password);if (mysqlpp::Query theQuery = conn->query(queryCommand.c_str())){if (mysqlpp::StoreQueryResult theResult = theQuery.store()){if (theResult.num_rows() == 0){return false;}else{return true;}}}return false;}EDIT: Iv refined my code a little, the error happens when i call theQuery.store() and i get some random access violation in xstring it says mysqlpp::BadQuery, can anyone see if my sql is correct?Also c++,vc2005.Well, i dont know how but iv fixed it woohooo[Edited by - ortsa on August 12, 2008 6:23:41 AM]
  Hello,I'm not sure if it has anything to do with your error, but shouldn't there be quotes around username and password ? kind regardsUncle   ;  I thought that too but in the documentation it says quotes arent needed for strings without spaces   ;  heres is just general advice. do not store passwords plaintext. store some sort of hash, like an md5 or something.   ;Quote:Original post by ortsaI thought that too but in the documentation it says quotes arent needed for strings without spacesBut if someone enters an SQL statement in username, you could get in trouble.UncleEDIT : but this is probably totally unrelated to the problem you have   ;Quote:Original post by UncleRemusQuote:Original post by ortsaI thought that too but in the documentation it says quotes arent needed for strings without spacesBut if someone enters an SQL statement in username, you could get in trouble.UncleEDIT : but this is probably totally unrelated to the problem you haveYes but thanks for bringing that up, should save me some trouble   ;Are the username and password filled ? Otherwise it could result in a bad query.SELECT * FROM login WHERE username = AND password =   ;  yes i tried couting them and they appear as they should   ;  Can't you catch the exception to see what's going on ? According to  the documentation you can get the DB error via the exception.