QueryResult result = CharacterDatabase.PQuery("SELECT x FROM y WHERE z='%u'", player->GetName());if (result <= 0){well...something happen here ;)}
Yeah I'm little bit confused I try to check if a database entry is 0 or smaller, but I didn't get it..Code: [Select]QueryResult result = CharacterDatabase.PQuery("SELECT x FROM y WHERE z='%u'", player->GetName());if (result <= 0){well...something happen here ;)}Yeah..something like that..but it didn't work..
QueryResult result = CharacterDatabase.PQuery("SELECT x FROM y WHERE z='%s'", player->GetName().c_str());
SELECT COUNT(column_name) FROM table_name;
QueryResult result = CharacterDatabase.PQuery("SELECT COUNT(x) FROM y WHERE z='%s'", player->GetName().c_str());if (result){Field* fields = result->Fetch();uint32 count = fields[0].GetUInt32();// Your code...}
Field * fields = result->Fetch(); uint32 result2 = fields[0].GetUInt32(); ChatHandler(player->GetSession()).PSendSysMessage("Points: %u", result2); if (result2 <= 0)