Example #1
0
PyString* MailDB::GetMailBody(int id) const
{
    DBQueryResult res;
    if (!sDatabase.RunQuery(res, "SELECT body FROM mailMessage WHERE messageID = %u", id))
        return NULL;
    if (res.GetRowCount() <= 0)
        return NULL;

    DBResultRow row;
    if (!res.GetRow(row) || row.IsNull(0))
        return NULL;

    return new PyString(row.GetText(0), row.ColumnLength(0));
}