本文整理匯總了PHP中DbHelper::delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP DbHelper::delete方法的具體用法?PHP DbHelper::delete怎麽用?PHP DbHelper::delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DbHelper
的用法示例。
在下文中一共展示了DbHelper::delete方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: stripslashes
<?php
require_once '../lib/global.php';
$id = stripslashes($_GET['id']);
$newsDbHelper = new DbHelper("pg_gamelink");
$idlist = split(';', $id);
$id = '';
for ($i = 0; $i < count($idlist); $i++) {
if ($i == 0) {
$id .= $idlist[$i];
} else {
$id .= " or id=" . $idlist[$i];
}
}
if ($newsDbHelper->delete($id) > 0) {
echo "true";
} else {
echo "false";
}
示例2: stripslashes
<?php
require_once '../lib/global.php';
$id = stripslashes($_GET['id']);
$classDbHelper = new DbHelper("pg_gameclass");
$idlist = split(';', $id);
$id = '';
$classid = 'delete from pg_gamelink where ';
for ($i = 0; $i < count($idlist); $i++) {
if ($i == 0) {
$id .= $idlist[$i];
$classid .= 'classid=' . $idlist[$i];
} else {
$id .= " or id=" . $idlist[$i];
$classid .= ' or classid=' . $idlist[$i];
}
}
if ($classDbHelper->querySql($classid) > 0 && $classDbHelper->delete($id)) {
echo "true";
} else {
echo "false";
}
示例3: DbHelper
<?php
/* TODO: Add code here */
require_once '../lib/global.php';
$conn = new DbHelper("pg_newsclass");
$id = $_GET['id'];
$type = $_GET['type'];
$name = mysql_escape_string(stripslashes($_GET['name']));
if ($_GET['type'] == 1) {
$conn->update($id, "name='{$name}'");
}
if ($_GET['type'] == 2) {
if ($conn->delete($id) > 0) {
echo "true";
} else {
echo "false";
}
}
if ($_GET['type'] == 3) {
$conn->insert('name', "'{$name}'");
}
echo "OK!";
echo "<script type='text/javascript' src='../js/common.js'></script><script>GotoOtherPage('EditNewsType.php','遊戲類型修改成功!')</script>";
示例4: stripslashes
<?php
require_once '../lib/global.php';
$id = stripslashes($_GET['id']);
$newsDbHelper = new DbHelper("pg_news");
if (1 == $newsDbHelper->delete($id)) {
echo "true";
} else {
echo "false";
}