本文整理汇总了PHP中BD::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP BD::delete方法的具体用法?PHP BD::delete怎么用?PHP BD::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BD
的用法示例。
在下文中一共展示了BD::delete方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deletetrajet
function deletetrajet($idtrajet, $iduser)
{
$BD = new BD('trajet');
$BD->delete("idtrajet", $idtrajet);
$BD->setUsedTable('user');
$BD->decr("nbtrajet", "iduser", $iduser);
}
示例2: BD
<?php
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
session_start();
require_once '../Config.class.php';
require_once '../../../app/Bd.class.php';
$BD = new BD('connecté');
$BD->delete('iduser', $_SESSION['iduser']);
$_SESSION = array();
if (isset($_COOKIE[session_name()])) {
setcookie(session_name(), '', time() - 4200, '/');
}
session_destroy();
header('Location: http://51.255.41.18/Aurora/m/');
示例3: BD
if (isset($_REQUEST["accion"])) {
$accion = $_REQUEST["accion"];
} else {
$accion = "";
}
if (isset($_REQUEST["id_persona"])) {
$id_persona = $_REQUEST["id_persona"];
} else {
$id_persona = "";
}
if ($accion == "eliminar") {
$bd = new BD();
$bd->beginTransaction();
try {
$parametros = array("id_persona" => $id_persona);
$res = $bd->delete(tablas::USUARIOS, $parametros);
if ($bd->myException->getEstado() == 0) {
$res1 = $bd->delete(tablas::PERSONAS, $parametros);
if ($bd->myException->getEstado() == 0) {
$estado = "ok";
$mensaje = Mensajes::REGISTRO_ELIMINADO;
$bd->commit();
} else {
$bd->rollBack();
$estado = "error";
$mensaje = $bd->myException->getMensaje();
}
} else {
$bd->rollBack();
$estado = "error";
$mensaje = $bd->myException->getMensaje();
示例4: BD
$bd = new BD();
$bd->start_transaction();
if ($_POST['id'] == 0) {
$dados['status'] = "Ativo";
$bd->insert('produtos', $dados);
$_POST['id'] = $bd->get("insert_id");
}
//UPDATE - produtos
$table = 'produtos';
$dados = array("nome_produto" => "'" . $_POST['nome_produto'] . "'", "detalhamento" => "'" . $_POST['detalhamento'] . "'", "cod_linha" => $_POST['linha'], "status" => "'" . $_POST['status'] . "'", "url" => "'" . $_POST['url'] . "'", "fios" => $_POST['fios'], "desconto" => "'" . $_POST['desconto'] . "'", "substituido" => $_POST['substituido_por']);
$where = "codigo={$_POST['id']}";
$bd->update($table, $dados, $where);
//DELETE - produto_aplicacao
$table1 = "produto_aplicacao";
$where1 = "cod_produto={$_POST['id']}";
$bd->delete($table1, $where1);
//INSERT - produto_aplicacao
foreach (array_keys($_POST) as $k) {
if (preg_match('/^aplicacao_/', $k)) {
$dados2 = array("cod_produto" => $_POST['id'], "cod_aplicacao" => $_POST[$k]);
$bd->insert($table1, $dados2);
}
}
//DELETE - produto_veiculo
$table2 = "produto_veiculo";
$str = "";
foreach (array_keys($_POST) as $k) {
if (preg_match('/^veiculo_registrado_/', $k)) {
$str .= " AND codigo<>{$_POST[$k]}";
}
}
示例5: deleteEvent
function deleteEvent($idevent)
{
$BD = new BD('participant');
$BD->delete('idevent', $idevent);
$BD->setUsedTable('event');
$BD->delete('idevent', $idevent);
}
示例6: removeCom
function removeCom($idcom)
{
$BD = new BD('commentaire');
$BD->delete('idcommentaire', $idcom);
}
示例7: date
foreach ($donnees as $value) {
print_r($value);
echo "</br>";
}
/* Test update */
$BD->update("nom", "Jeanne", "nom", "Jean");
echo "<h2>Test Fonction UPDATE </h2></br>";
$donnees = $BD->selectAll();
foreach ($donnees as $value) {
print_r($value);
echo "</br>";
echo "{$value->nom}";
echo "</br>";
}
/* Test delete */
$BD->delete("nom", "Jeanne");
echo "<h2>Test Fonction DELETE </h2></br>";
$donnees = $BD->selectAll();
foreach ($donnees as $value) {
print_r($value);
echo "</br>";
echo "{$value->nom}";
echo "</br>";
}
echo "<h2>Test Changement de table </h2></br>";
echo "Objet crée sur la table : " . $BD->getUsedTable() . "</br>";
$BD->setUsedTable("trajet");
echo "Objet modifier sur la table : " . $BD->getUsedTable() . "</br>";
/* Test Fonction addTrajet */
$BD->addTrajet("Boulogne", "Bois", date("H:i:s"), date("H:i:s"), 50, 2, "Fiat Punto", 1);
echo "<h2>Test Fonction addTrajet </h2></br>";