mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-01 19:42:28 +00:00
CountBugs converted to QueryDatabase
This commit is contained in:
parent
87efd22394
commit
a2280d1fe5
@ -384,21 +384,16 @@ bool EQW::SetPublicNote(uint32 charid, const char *note) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int EQW::CountBugs() {
|
int EQW::CountBugs() {
|
||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
std::string query = "SELECT count(*) FROM bugs where status = 0";
|
||||||
char* query = 0;
|
auto results = database.QueryDatabase(query);
|
||||||
MYSQL_RES *result;
|
if (!results.Success())
|
||||||
MYSQL_ROW row;
|
return 0;
|
||||||
if(database.RunQuery(query, MakeAnyLenString(&query, "SELECT count(*) FROM bugs where status = 0"), errbuf, &result)) {
|
|
||||||
safe_delete_array(query);
|
if (results.RowCount() == 0)
|
||||||
if((row = mysql_fetch_row(result))) {
|
return 0;
|
||||||
int count = atoi(row[0]);
|
|
||||||
mysql_free_result(result);
|
auto row = results.begin();
|
||||||
return count;
|
return atoi(row[0]);
|
||||||
}
|
|
||||||
mysql_free_result(result);
|
|
||||||
}
|
|
||||||
safe_delete_array(query);
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> EQW::ListBugs(uint32 offset) {
|
std::vector<std::string> EQW::ListBugs(uint32 offset) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user