本文整理匯總了PHP中db::delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP db::delete方法的具體用法?PHP db::delete怎麽用?PHP db::delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類db
的用法示例。
在下文中一共展示了db::delete方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: borrar_usuario
public function borrar_usuario($id)
{
parent::__construct($this->db, $this->tabla);
$args = array();
$args["where"] = array("idUsuario=:id");
$args["valores"] = array(":id" => $id);
parent::delete($array);
}
示例2: delete
function delete($log_id)
{
db::table('admin_log_trash');
db::where('log_id', $log_id);
db::delete();
@unlink(SYS_ROOT . 'var/trash/' . $log_id . '_conf.zip');
@unlink(SYS_ROOT . 'var/trash/' . $log_id . '_base.zip');
@unlink(SYS_ROOT . 'var/trash/' . $log_id . '_files.zip');
}
示例3: remove_note
function remove_note($id)
{
$db = new db();
$result = $db->read("notes", "id = :id", array(":id" => $id), "super_note");
if (!$result || $result[0]['super_note']) {
return false;
}
$result = $db->delete("notes", "id = :id", array(":id" => $id));
return $result;
}
示例4: delete
function delete($id)
{
$db = new db("components");
$all = $db->convert($db->all());
foreach ($all as $a) {
if ($a['id'] == $id) {
$db->delete($a['title']);
return true;
}
}
return false;
}
示例5: delete
public function delete()
{
error_log(__METHOD__);
if ($this->g->in['i']) {
$res = db::delete([['id', '=', $this->g->in['i']]]);
$this->g->in['i'] = 0;
header("Location: ?o=" . $this->o);
exit;
} else {
return 'Error with Delete';
}
}
示例6: delete
function delete()
{
$img_id = params::get('img_id');
db::table('images');
db::where('img_id', $img_id);
db::delete();
$dir = IMAGES_ROOT . 'index/';
$file = $dir . $img_id . '.jpg';
$file_m = $dir . $img_id . '_m.jpg';
@unlink($file);
@unlink($file_m);
}
示例7: delete
function delete($block_id = false, $dump = true)
{
if (!$block_id) {
$block_id = params::get('block_id');
}
if ($dump) {
trash::tables('blocks');
trash::conf('blocks');
trash::dump();
}
db::table('blocks');
db::where('block_id', $block_id);
db::delete();
conf::delete('blocks', $block_id);
}
示例8: saveVersion
function saveVersion($tmpl_id, $code)
{
db::table('templates_versions');
db::where('tmpl_id', $tmpl_id);
db::where('version_code', $code);
db::order('version_date', 'DESC');
db::limit(1);
db::select();
if (db::rows() == 0) {
/*
delete over 20
*/
db::table('templates_versions');
db::where('tmpl_id', $tmpl_id);
db::order('version_date', 'DESC');
db::limit(20, 100);
db::delete();
db::table('templates_versions');
db::insert('', 'NOW()', $code, '', '', $tmpl_id, ADMIN_USER_ID, ADMIN_SITE_ID);
}
}
示例9: test_queries
private function test_queries()
{
// Test insert :
$query = db::insert('glusers')->columns('login', 'password')->values('test1', 'test1')->values('test2', 'test2')->values('test3', 'test3');
db::cn()->exec($query);
// Test prepared insert :
$query = db::insert('glprofiles')->columns('id', 'email')->values(null, 'test1')->values(null, 'test2')->values(null, 'test3');
$stmt = db::cn()->prepare($query);
$stmt->execute();
// Test update :
$query = db::update('glusers', $u)->set('password', db::select('glprofiles')->columns("count(*)"))->where("{$u->login} = ?", 'test2');
db::cn()->exec($query);
// Test Delete :
$query = db::delete('glprofiles', $u)->where("{$u->id} = ?", 3);
db::cn()->exec($query);
// Test Select :
$query = db::select('glusers', $a)->left('glusers', $b)->on("{$a->id} = {$b->id}")->where("{$a->login} LIKE ?", 'test%')->columns($a->id, $a->login, $b->id, $b->login)->where("{$a->id} = ?", 3)->groupby($a->id, $a->login, $b->id, $b->login)->orderby($a->id, $a->login, $b->id, $b->login)->limit(1)->offset(0);
$stmt = db::cn()->query($query);
$query = db::delete('users', $u)->where("NOT EXISTS ( ? )", $sub = db::select());
$sub->from('posts', $ps)->where("{$ps->user_id} = {$u->id}");
echo db::cn()->compile($query);
/*foreach($stmt as $row) {
var_dump($row);
var_dump($a->id($row));
}*/
/*
$query = db::select('glusers', $u)->columns($u->id, $u->login, $u->password);
$statement = db::cn()->prepare($query);
$statement->execute();
while($res = $statement->fetch(PDO::FETCH_BOTH)) {
//var_dump($u['login']);
var_dump($res);
echo $test;
}*/
/*
$stmt = db::cn()->query("select login as login from glusers");
//$stmt->bindColumn('login', $test);
$stmt->setFetchMode(PDO::FETCH_BOTH);
while($res = $stmt->fetch(PDO::FETCH_ASSOC)) {
print_r($res);
//echo $test;
}
*/
//$arr = $statement->fetchAll();
//print_r($arr);
}
示例10: deletePoint
function deletePoint($point_id = false)
{
if (!$point_id) {
$point_id = params::get('point_id');
}
db::table('menus_points');
db::where('point_id', $point_id);
db::delete();
}
示例11: deletesection
function deletesection()
{
$section_id = params::get('section_id');
db::table('info_sections');
db::where('section_id', $section_id);
db::delete();
db::table('info_items');
db::where('section_id', $section_id);
db::delete();
}
示例12: delete
function delete($KID)
{
$abfrage = new db();
$abfrage->delete("kategorie", "KID='{$KID}'");
}
示例13: delete
/**
* Deletes the current object's associated database row.
* The object will still contain valid data until it is destroyed.
*
* @return integer
*/
public function delete()
{
if (AutoModeler::STATE_LOADED) {
$this->_state = AutoModeler::STATE_DELETED;
return db::delete($this->_table_name)->where($this->_primary_key, '=', $this->_data[$this->_primary_key])->execute($this->_db);
}
throw new AutoModeler_Exception('Cannot delete a non-loaded model ' . get_class($this) . '!', array(), array());
}
示例14: db
$op = $_POST['operation'];
$db = new db();
if ($op == "edit") {
$id = $_POST['id'];
$title = $_POST['title'];
$text = $_POST['text'];
if ($db->update("content", "title='" . $title . "', content='" . $text . "'", " id = '" . $id . "'")) {
echo '0';
} else {
echo '1';
}
} elseif ($op == "add") {
$title = $_POST['title'];
$text = $_POST['text'];
$col[] = "title";
$col[] = "content";
$var[] = $title;
$var[] = $text;
//db::setDebug(2);
if ($db->insert("content", $col, $var)) {
if ($db->insert("navigation_links", array("link", "type", "content_id", "titel", "tpl"), array("content", "1", $db->getLastId(), $title, "1"))) {
echo '0';
}
} else {
echo '1';
}
} elseif ($op == "delete") {
$id = $_POST['id'];
$db->delete("content", "id = '" . $id . "'");
$db->delete("navigation_links", "content_id = '" . $id . "'");
}
示例15: elseif
$var[] = $link;
$var[] = $position;
$var[] = $parent;
$var[] = $admin;
$var[] = $visible;
//db::setDebug(2);
if ($db->insert("navigation", $col, $var)) {
echo '0';
} else {
echo '1';
}
} elseif ($op == "edit") {
$id = $_POST['id'];
$name = $_POST['name'];
$link = $_POST['link'];
$position = $_POST['position'];
$parent = $_POST['parent'];
$admin = $_POST['admin'];
$visible = $_POST['visible'];
if ($admin == "") {
$admin = 0;
}
if ($db->update("navigation", "name='" . $name . "', link_id='" . $link . "', position='" . $position . "', parent='" . $parent . "',admin='" . $admin . "',visible='" . $visible . "'", " id = '" . $id . "'")) {
echo '0';
} else {
echo '1';
}
} elseif ($op == "delete") {
$id = $_POST['id'];
$db->delete("navigation", "id = '" . $id . "'");
}