Elzza 0 Posted August 29, 2014 Share Posted August 29, 2014 I have problem, my code isn't reading properly data from MySQL, type: smallint. There is number: 64, but this function show me number: 54. I don't know what is wrong. My code: short MyFunction() { ... std::auto_ptr<SQLMsg> msg(DBManager::instance().DirectQuery("SELECT coins FROM player.itemshop WHERE name='%s';", pCharName)); MYSQL_ROW row_coins = mysql_fetch_row(msg->Get()->pSQLResult); return row_coints[0][0]; } Link to comment Share on other sites More sharing options...
Honorable Member martysama0134 7176 Posted August 29, 2014 Honorable Member Share Posted August 29, 2014 The rows retrieved back are char* and not already "numbers". Look here how to do it. (little sample) Check out my GitHub Link to comment Share on other sites More sharing options...
Elzza 0 Posted August 29, 2014 Author Share Posted August 29, 2014 Thank You! Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now