本文整理汇总了C++中DBResult::fetchRow方法的典型用法代码示例。如果您正苦于以下问题:C++ DBResult::fetchRow方法的具体用法?C++ DBResult::fetchRow怎么用?C++ DBResult::fetchRow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBResult
的用法示例。
在下文中一共展示了DBResult::fetchRow方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onSessionEvent
static bool onSessionEvent(EVENT *ev)
{
InPacket in(ev->packet->data, ev->packet->dataLen);
Pool *pool = ev->s->getPool();
PRES *pres = new(pool) PRES(pool);
in >> pres->status >> pres->p2pVer;
pres->realIP = in.read32();
pres->msgPort = in.read16();
ev->s->registerEvent(moduleIndex, pres);
DBResult *res;
DB_ROW row;
SQLStmt sql(ev->conn);
SQL_APPEND(sql, "SELECT contact, subscrpt FROM roster WHERE id=");
sql << ev->s->getUserID();
if (!ev->conn->query(sql.getData(), sql.getLength()) ||
!(res = ev->conn->getResult()))
return false;
const char *name = ev->s->getUserName();
while ((row = res->fetchRow()) != NULL) {
const char *c = row[0];
uint8 sub = atoi(row[1]);
if (sub & SUB_TO) {
PACKET p;
p.cmd = CMD_SRV_PROBE_STATUS;
p.from = name;
p.to = c;
p.data = NULL;
p.dataLen = 0;
p.online = true;
ev->mapi->deliver(&p);
}
if ((sub & SUB_FROM) && (pres->status != STATUS_INVIS))
addAndNotify(ev, pres, c);
}
res->destroy();
return false;
}