本文整理汇总了PHP中DataBase::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP DataBase::delete方法的具体用法?PHP DataBase::delete怎么用?PHP DataBase::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataBase
的用法示例。
在下文中一共展示了DataBase::delete方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: json_encode
<?php
session_start();
include '../dataBaseClass/connection.php';
$id = filter_input(INPUT_POST, "idPaquete");
$tipoPoliza = filter_input(INPUT_POST, "tipoPoliza");
$cobertura = filter_input(INPUT_POST, "cobertura");
$cDb = new DataBase();
$lCorrecto = $cDb->delete("Paquete", "idPaquete = '{$id}' AND tipoPoliza = '{$tipoPoliza}' AND cobertura = '{$cobertura}'");
$mensaje = "Datos del tipo de poliza eliminados correctamente";
if (!$lCorrecto) {
$mensaje = "Error al tratar de eliminar la informacion del tipo de poliza: " . $cDb->LastError;
}
echo json_encode(array('eliminado' => $lCorrecto, 'mensaje' => $mensaje));
示例2:
ob_end_clean();
echo '{"success":false,"message":"error: no columns given to query"}';
exit;
}
if ($objParseColumns->success == false) {
ob_end_clean();
echo '{"success":false,"message":"error: no columns given to query"}';
exit;
}
$dataBase->parseJoin($strJoin);
$dataBase->parseRestrictions($strRestrictions);
$dataBase->parseOrderBy($strOrder);
$dataBase->parseGroupBy($strGroupBy);
$dataBase->parseLimit($strLimit);
$dataBase->parseValues($strValues);
ob_end_clean();
switch ($strQuery) {
case 'SELECT':
echo $dataBase->select();
break;
case 'INSERT':
echo $dataBase->insert();
break;
case 'DELETE':
echo $dataBase->delete();
break;
case 'UPDATE':
echo $dataBase->update();
break;
}
exit;
示例3: while
echo $sql;
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result)) {
$get_decument_id = $row['c_id'];
echo $get_decument_id;
}
$con->update('documentation', array('course' => $course, 'event' => $event, 'c_name' => $course_name, 'c_num' => $course_id, 'c_location' => $pleace, 'c_collage_index' => $collage, 'c_dept' => $dept, 'c_price' => $price, 'c_gender' => $type, 'c_target_group' => $target, 'c_duration' => $how_long, 'c_req_num' => $at_least, 'c_reg_time' => $start_date, 'c_max_num' => $at_most, 'c_time_from' => $start_time, 'c_time_to' => $end_time, 'c_major' => $course_about, 'c_languate' => $language, 'c_goals' => $goals, 'c_doc_desc' => $description, 'c_notes' => $notes), array('c_id', $get_decument_id));
}
if (isset($_POST['delete_course_id'])) {
//echo "it is set <br/>";
$course_id = $_POST['delete_course_id'];
$sql = "SELECT c_id FROM documentation where c_num='" . $course_id . "' ";
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result)) {
$get_decument_id = $row['c_id'];
}
$con->delete('comunity_service', 'documentation', 'c_id="' . $get_decument_id . '"');
}
//else{echo "not set";}
}
if (isset($_POST['delete_course_id'])) {
//echo "it is set <br/>";
$course_id = $_POST['delete_course_id'];
$sql = "SELECT c_id FROM documentation where c_num='" . $course_id . "' ";
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result)) {
$get_decument_id = $row['c_id'];
}
$con->delete('comunity_service', 'documentation', 'c_id="' . $get_decument_id . '"');
}
//else{echo "not set";}
示例4: header
if (!hash_equals($authKey, crypt($auth, $authKey))) {
header("HTTP/1.1 403 Forbidden");
die(json_encode(array('code' => 'error', 'comment' => 'auth failed with authkey: ' . $auth)));
}
$db = new DataBase($dbConfig);
switch ($function) {
case 'listall':
echo $db->listall();
break;
case 'save':
if ($db->exists($itemName)) {
echo $db->update($itemName, $itemCount);
} else {
echo $db->save($itemName, $itemCount);
}
break;
case 'update':
echo $db->update($itemName, $itemCount);
break;
case 'delete':
echo $db->delete($itemName);
break;
case 'clear':
echo $db->clear();
break;
default:
die(json_encode(array('code' => 'error', 'comment' => 'function not specified')));
}
?>
示例5: escapeString
return true;
} else {
return false;
}
}
}
public function escapeString($data)
{
return $this->myconn->real_escape_string($data);
}
public function getSql()
{
$val = $this->myQuery;
$this->myQuery = array();
return $val;
}
}
$obj = new DataBase();
//
$obj->connect("localhost", "root", "", "comunity_service");
//$obj->update('comunity_service','login',array('username'=>'Bernard!'),array('ID',3));
//$obj->tableExists("comunity_service",'login')
// $con=new DataBase();
// $con->connect("localhost","root","","comunity_service");
//select($table, $rows = '*', $where = null, $order = null);
$obj->delete('comunity_service', 'login', 'id=6');
$obj->select('comunity_service', 'login', '*', 'ID="1"', 'id DESC');
$res = $obj->getResult();
echo "<br/>";
print_r($res);
//$obj->getSql();
示例6: json_encode
$aDatos['nombre'] = filter_input(INPUT_POST, "nombre");
$aDatos['direccion'] = filter_input(INPUT_POST, "direccion");
$aDatos['telefono'] = filter_input(INPUT_POST, "telefono");
$aDatos['portal'] = filter_input(INPUT_POST, "portal");
$aTipos = array();
if (isset($_POST['chkTipoPoliza'])) {
$aTipos = $_POST['chkTipoPoliza'];
}
$cDb = new DataBase();
if ($idCompania != "") {
$sWhere = "idCompania = {$idCompania}";
$lCorrecto = $cDb->update("Companias", $aDatos, $sWhere);
} else {
$lCorrecto = $cDb->insert("Companias", $aDatos);
$idCompania = strval($cDb->LastInsertedId);
}
$mensaje = "Datos de la compañia guardados correctamente";
if (!$lCorrecto) {
$mensaje = "Error al tratar de guardar la informacion de la compañia: " . mysqli_stmt_error($stmt);
}
if ($lCorrecto) {
// Borramos los datos de los tipos de polizas y agregamos las nuevas seleccionadas
$cDb->delete("TipoPolizaCompania", "idCompania = {$idCompania}");
foreach ($aTipos as $value) {
$aData = array();
$aData['idCompania'] = $idCompania;
$aData['idTipo'] = $value;
$cDb->insert("TipoPolizaCompania", $aData, false);
}
}
echo json_encode(array('correcto' => $lCorrecto, 'mensaje' => $mensaje));
示例7: json_encode
<?php
session_start();
include '../dataBaseClass/connection.php';
$idAgente = filter_input(INPUT_POST, "idAgente");
$cDb = new DataBase();
$lCorrecto = $cDb->delete("agente", "idAgente = '{$idAgente}'");
$mensaje = "Datos del agente eliminados correctamente";
if (!$lCorrecto) {
$mensaje = "Error al tratar de eliminar la informacion del agente: " . $cDb->LastError;
}
echo json_encode(array('eliminado' => $lCorrecto, 'mensaje' => $mensaje));
示例8: json_encode
<?php
session_start();
include './dataBaseClass/connection.php';
$idCliente = filter_input(INPUT_POST, "idCliente");
$cDb = new DataBase();
$lCorrecto = $cDb->delete("cliente", "idCliente = {$idCliente}");
$mensaje = "Datos del cliente eliminados correctamente";
if (!$lCorrecto) {
$mensaje = $cDb->LastError;
}
echo json_encode(array('eliminado' => $lCorrecto, 'mensaje' => $mensaje));