mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-15 16:41:29 +00:00
GetAccountIDByChar (id) converted to StringFormat
This commit is contained in:
parent
85895d01eb
commit
a64ef36d06
@ -685,19 +685,16 @@ uint32 Database::GetAccountIDByChar(const char* charname, uint32* oCharID) {
|
|||||||
|
|
||||||
// Retrieve account_id for a given char_id
|
// Retrieve account_id for a given char_id
|
||||||
uint32 Database::GetAccountIDByChar(uint32 char_id) {
|
uint32 Database::GetAccountIDByChar(uint32 char_id) {
|
||||||
char* query = nullptr;
|
std::string query = StringFormat("SELECT account_id FROM character_ WHERE id=%i", char_id);
|
||||||
|
|
||||||
auto results = QueryDatabase(query, MakeAnyLenString(&query, "SELECT account_id FROM character_ WHERE id=%i", char_id));
|
auto results = QueryDatabase(query);
|
||||||
|
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
{
|
{
|
||||||
LogFile->write(EQEMuLog::Error, "Error in GetAccountIDByChar query '%s': %s", query, results.ErrorMessage().c_str());
|
LogFile->write(EQEMuLog::Error, "Error in GetAccountIDByChar query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
safe_delete_array(query);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
safe_delete_array(query);
|
|
||||||
|
|
||||||
if (results.RowCount() != 1)
|
if (results.RowCount() != 1)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user