本文整理匯總了PHP中Zend_Db::insert方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Db::insert方法的具體用法?PHP Zend_Db::insert怎麽用?PHP Zend_Db::insert使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend_Db
的用法示例。
在下文中一共展示了Zend_Db::insert方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addRecord
public function addRecord($domain, $name, $type, $content, $ttl = 86400, $prio = 0)
{
$domainId = $domain;
if (!is_numeric($domain)) {
$domainId = $this->getDomainId($domain);
}
$this->_db->insert('records', array('domain_id' => $domainId, 'name' => $name, 'type' => strtoupper($type), 'content' => trim($content), 'ttl' => intval($ttl), 'prio' => intval($prio)));
}
示例2: save
/**
* Saves the current attributes to the DB.
*/
public function save()
{
$this->beforeSave();
// Trims out non-fields and serializes data for DB entry.
$info = $this->info(true, true);
if (!$this->exists) {
$this->beforeCreate();
$this->_zendDb->insert($this->tableName(), $info);
if (!$this->id) {
$this->id = $this->_zendDb->lastInsertId();
}
$this->_afterCommand('insert');
$this->exists = true;
$this->afterCreate();
} else {
$this->_zendDb->update($this->tableName(), $info, 'id = ' . $this->_zendDb->quote($this->id));
$this->_afterCommand('update');
}
$this->afterSave();
$this->_lastSaveRow = $this->info();
}
示例3: insertIntro
/**
* Enter description here ...
* @param array $arr
* @param string $id
*/
public function insertIntro($data)
{
$result = $this->db->insert('intro', $data);
return $result;
}