mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-11 02:52:26 +00:00
ListBugs converted to QueryDatabase
This commit is contained in:
parent
a2280d1fe5
commit
34f051ab9a
@ -398,18 +398,15 @@ int EQW::CountBugs() {
|
|||||||
|
|
||||||
std::vector<std::string> EQW::ListBugs(uint32 offset) {
|
std::vector<std::string> EQW::ListBugs(uint32 offset) {
|
||||||
std::vector<std::string> res;
|
std::vector<std::string> res;
|
||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
std::string query = StringFormat("SELECT id FROM bugs WHERE status = 0 limit %d, 30", offset);
|
||||||
char* query = 0;
|
auto results = database.QueryDatabase(query);
|
||||||
MYSQL_RES *result;
|
|
||||||
MYSQL_ROW row;
|
if (!results.Success())
|
||||||
if(database.RunQuery(query, MakeAnyLenString(&query, "SELECT id FROM bugs WHERE status = 0 limit %d, 30", offset), errbuf, &result)) {
|
return res;
|
||||||
safe_delete_array(query);
|
|
||||||
while((row = mysql_fetch_row(result))) {
|
for (auto row = results.begin();row != results.end(); ++row)
|
||||||
res.push_back(row[0]);
|
res.push_back(row[0]);
|
||||||
}
|
|
||||||
mysql_free_result(result);
|
|
||||||
}
|
|
||||||
safe_delete_array(query);
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user