當前位置: 首頁>>代碼示例>>PHP>>正文


PHP db::delete方法代碼示例

本文整理匯總了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);
 }
開發者ID:numart,項目名稱:Recetas_cocina,代碼行數:8,代碼來源:usuario.class.php

示例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');
 }
開發者ID:rigidus,項目名稱:ea,代碼行數:9,代碼來源:trash.php

示例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;
}
開發者ID:thuraucsy,項目名稱:holiday,代碼行數:10,代碼來源:note.php

示例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;
 }
開發者ID:jakerb,項目名稱:Tucan-CMS,代碼行數:12,代碼來源:component.php

示例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';
     }
 }
開發者ID:netserva,項目名稱:www,代碼行數:12,代碼來源:crud.php

示例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);
 }
開發者ID:rigidus,項目名稱:ea,代碼行數:12,代碼來源:main.module.php

示例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);
 }
開發者ID:rigidus,項目名稱:ea,代碼行數:15,代碼來源:main.module.php

示例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);
     }
 }
開發者ID:rigidus,項目名稱:ea,代碼行數:21,代碼來源:main.module.php

示例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);
 }
開發者ID:rlm80,項目名稱:Glue,代碼行數:46,代碼來源:test.php

示例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();
 }
開發者ID:rigidus,項目名稱:ea,代碼行數:9,代碼來源:main.module.php

示例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();
 }
開發者ID:rigidus,項目名稱:ea,代碼行數:10,代碼來源:main.module.php

示例12: delete

 function delete($KID)
 {
     $abfrage = new db();
     $abfrage->delete("kategorie", "KID='{$KID}'");
 }
開發者ID:max2605,項目名稱:Katalogsierungsprogamm,代碼行數:5,代碼來源:function.php

示例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());
 }
開發者ID:alle,項目名稱:auto-modeler,代碼行數:14,代碼來源:core.php

示例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 . "'");
}
開發者ID:Zorox3,項目名稱:StarShadow,代碼行數:31,代碼來源:dbOperations.php

示例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 . "'");
}
開發者ID:Zorox3,項目名稱:StarShadow,代碼行數:31,代碼來源:dbOperations.php


注:本文中的db::delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。