Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AccountInfo MySQLGunzDB::GetAccountInfo(const char* username, const char* password)
- {
- AccountInfo accountInfo;
- try
- {
- mysqlpp::Query query = gunzconn.query();
- query << "select aid, ugradeid, pgradeid from account where username=" << mysqlpp::quote << username
- << "and password=md5(" << mysqlpp::quote << password << ") LIMIT 1";
- mysqlpp::StoreQueryResult result = query.store();
- if (result.num_rows() < 1)
- {
- accountInfo.AccountId = -1;
- return accountInfo;
- }
- strcpy(accountInfo.AccountName, username);
- accountInfo.AccountId = result[0]["aid"];
- accountInfo.AccountAccess = result[0]["ugradeid"];
- accountInfo.AccountPremium = result[0]["pgradeid"];
- return accountInfo;
- }
- catch (mysqlpp::Exception e)
- {
- printf ("Error: %s\n", e.what());
- }
- accountInfo.AccountId = -1;
- return accountInfo;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement