本文整理匯總了PHP中DBAdapter::executeNoresSQL方法的典型用法代碼示例。如果您正苦於以下問題:PHP DBAdapter::executeNoresSQL方法的具體用法?PHP DBAdapter::executeNoresSQL怎麽用?PHP DBAdapter::executeNoresSQL使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DBAdapter
的用法示例。
在下文中一共展示了DBAdapter::executeNoresSQL方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: drop
public function drop()
{
$prim = self::$_primaryField;
$preparedId = $this->_prepareValue(self::$_metadata[$prim], $this->_id);
$sql = "DELETE FROM `{$this->_table}` WHERE `{$prim}` = {$preparedId} ";
$res = $this->_db->executeNoresSQL($sql);
if (!$res) {
throw new ModelException("Invalid query - " . $this->_db->getError());
}
$this->_data = array();
$this->_id = null;
}
示例2: pushMsg
public function pushMsg($desc, $detail, $type = MSG_SYSINFO)
{
$o_db = new DBAdapter(array('host' => $this->dbConf->crawler->host, 'username' => $this->dbConf->crawler->username, 'password' => $this->dbConf->crawler->password, 'schema' => $this->dbConf->crawler->schema, 'host' => $this->dbConf->crawler->host));
$sql = "INSERT INTO " . $this->dbConf->crawler->schema . ".messages (m_description,m_detail) VALUES (";
$sql .= "'" . $type . addslashes($desc) . "','" . addslashes($detail) . "')";
//executeNoresSQL($query)
$done = false;
if (!$o_db->executeNoresSQL($sql)) {
unset($o_db);
} else {
unset($o_db);
$done = true;
}
return $done;
}