本文整理汇总了PHP中Db::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Db::delete方法的具体用法?PHP Db::delete怎么用?PHP Db::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Db
的用法示例。
在下文中一共展示了Db::delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteCurrency
public function deleteCurrency($currencyId)
{
global $mySession;
$db = new Db();
$condition1 = "currency_id='" . $currencyId . "'";
$db->delete(CURRENCY, $condition1);
}
示例2: deleteSpecification
public function deleteSpecification($specId)
{
echo $specId;
global $mySession;
$db = new Db();
$condition1 = "spec_id='" . $specId . "'";
$db->delete(SPECIFICATION, $condition1);
$db->delete(SPEC_CHILD, $condition1);
}
示例3: deleteAttribute
public function deleteAttribute($attributeId)
{
global $mySession;
$db = new Db();
$condition1 = "attribute_id='{$attributeId}'";
$db->delete(ATTRIBUTE, $condition1);
//delete all attribute_ans entries
$condition2 = "ans_attribute_id= '{$attributeId}'";
$db->delete(ATTRIBUTE_ANS, $condition2);
}
示例4: deletereview
public function deletereview($ptyleId)
{
global $mySession;
$db = new Db();
$condition1 = "review_id='" . $ptyleId . "'";
$chkQuery = $db->runQuery("select * from " . OWNER_REVIEW . " where review_id = '" . $ptyle_id . "' ");
if ($chkQuery[0]['parent_id'] == '0') {
$condition = "parent_id=" . $ptyle_id;
$db->delete(OWNER_REVIEW, $condition);
}
$db->delete(OWNER_REVIEW, $condition1);
}
示例5: deleteAmenity
public function deleteAmenity($ptyleId)
{
global $mySession;
$db = new Db();
$condition1 = "amenity_id='" . $ptyleId . "'";
$db->delete(AMENITY, $condition1);
}
示例6: delete
protected function delete()
{
if (empty($this->id)) {
throw new Exception('Delete error - Undefined ' . self::getClass() . ' id');
}
return Db::delete('DELETE FROM ' . self::getDbTable() . ' WHERE id = :id', array('id' => $this->id));
}
示例7: deleteProtype
public function deleteProtype($ptyleId)
{
global $mySession;
$db = new Db();
$condition1 = "ptyle_id='" . $ptyleId . "'";
$db->delete(PROPERTYTYPE, $condition1);
}
示例8: upload
function upload()
{
global $root;
if ($_FILES['sub']['size'] == 0 && $_FILES['sub']['error'] > 0) {
return 'Error al subir el subtítulo.';
}
$file = $_FILES['sub']['name'];
$frame = Request::getPost('frame');
$comment = Request::getPost('comment');
$credits = Request::getPost('credits');
if (empty($frame)) {
return 'Falta el frame.';
}
$format = substr($file, -3);
$formatName = Formats::get($format);
if (empty($formatName)) {
return 'El archivo no es de un formato válido.';
}
$filename = substr($file, 0, strlen($file) - 4);
$id = Db::insert('subs', array('filename' => $filename, 'ext' => $format, 'frame' => $frame, 'comment' => $comment, 'credits' => $credits, 'time' => time()));
$fullpath = "{$root}/upload/{$id}";
# $fullpath = "/var/www/subs/$id";
if (!@move_uploaded_file($_FILES['sub']['tmp_name'], $fullpath)) {
if ($id) {
Db::delete('subs', "id = '{$id}'");
}
return 'No se logró subir el archivo, intente nuevamente en unos minutos.';
}
header("Location: /{$id}.html");
}
示例9: clearAllSessions
public function clearAllSessions($user)
{
if (empty($user)) {
return;
}
Db::delete('Session', 'user_id = ?', array($user->getId()));
}
示例10: deleteOffer
public function deleteOffer($sId)
{
global $mySession;
$db = new Db();
$condition1 = "id='" . $sId . "'";
$db->delete(SPCL_OFFER_TYPES, $condition1);
}
示例11: deleteNews
public function deleteNews($ptyleId)
{
global $mySession;
$db = new Db();
$condition1 = "news_id='" . $ptyleId . "'";
$db->delete(NEWS, $condition1);
}
示例12: save
public static function save()
{
if (self::$settings !== null) {
// Da nicht gewährleistet ist, dass überhaupt ein Eintrag existiert, oder dass es wirklich nur einer ist,
// einfach die Settings-Tabelle komplett platt machen und den Eintrag neu erzeugen.
Db::delete('settings', '1', array());
Db::insert('settings', array('json' => json_encode(self::$settings)));
}
}
示例13: delete
/**
* @return integer
*/
public function delete()
{
if (null === $this->identifier) {
throw new Exception('Identifier not found.');
}
$affected = $this->db->delete($this->table, array($this->identifier => $this->properties[$this->identifier]->get()));
$this->clear();
return $affected;
}
示例14: delStoreWM
/**
* 删除水印
*
* @param int $id 记录ID
* @return bool 布尔类型的返回结果
*/
public function delStoreWM($id){
if (intval($id) > 0){
$where = " wm_id = '". intval($id) ."'";
$result = Db::delete('store_watermark',$where);
return $result;
}else {
return false;
}
}
示例15: UpdateGroupTopic
public function UpdateGroupTopic($dataForm, $topic_id)
{
global $mySession;
$db = new Db();
$sqlstr = "select * from " . GROUP_TPOIC . " where topic_name='" . $dataForm['topic_name'] . "' and topic_id!='" . $topic_id . "'";
$chkQry = $db->runQuery($sqlstr);
if ($chkQry != "" and count($chkQry) > 0) {
return 0;
} else {
$dataForm['topic_status'] = 1;
$dataForm['created_by'] = $mySession->adminId;
$update_condition = "topic_id='" . $topic_id . "'";
$topicgroup = $dataForm['topic_group'];
unset($dataForm['topic_group']);
if ($dataForm['topic_access_type'] == 1) {
$groupMember = $dataForm['group_member'];
} else {
$groupMember = "";
}
unset($dataForm['group_member']);
$db->modify(GROUP_TPOIC, $dataForm, $update_condition);
$condition = "topic_id='" . $topic_id . "'";
$db->delete(GROUP_TPOIC_CATEGORIES, $condition);
$data['m_status'] = 1;
$db->modify(GROUP_MEMBER, $data, $condition);
//$db->delete(GROUP_MEMBER,$condition);
unset($dataForm);
if (is_array($topicgroup)) {
foreach ($topicgroup as $key => $value) {
$dataForm['category_id'] = $value;
$dataForm['topic_id'] = $topic_id;
$db->save(GROUP_TPOIC_CATEGORIES, $dataForm);
unset($dataForm);
}
}
if (is_array($groupMember)) {
foreach ($groupMember as $key => $value) {
if (isset($dataForm)) {
unset($dataForm);
}
$dataForm['m_status'] = 1;
$sqlstr = "select * from " . GROUP_MEMBER . " where member_id='" . $value . "' and topic_id='" . $topic_id . "'";
if ($chkQry != "" and count($chkQry) > 0) {
$update_condition = "member_id='" . $value . "' and topic_id='" . $topic_id . "'";
$db->modify(GROUP_MEMBER, $dataForm, $update_condition);
} else {
$dataForm['member_id'] = $value;
$dataForm['topic_id'] = $topic_id;
$db->save(GROUP_MEMBER, $dataForm);
}
unset($dataForm);
}
}
return 1;
}
}