本文整理汇总了PHP中Sql::pDelete方法的典型用法代码示例。如果您正苦于以下问题:PHP Sql::pDelete方法的具体用法?PHP Sql::pDelete怎么用?PHP Sql::pDelete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sql
的用法示例。
在下文中一共展示了Sql::pDelete方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: remove
/**
*
* @param $type
* @param $object_id the object who owns the bookmark
*/
public static function remove($type, $object_id, $owner = 0)
{
if (!is_numeric($type) || !is_numeric($object_id) || !is_numeric($owner)) {
throw new \Exception('noo');
}
$session = SessionHandler::getInstance();
$q = 'DELETE FROM ' . self::$tbl_name . ' WHERE owner = ?' . ' AND value = ?' . ' AND type = ?';
return Sql::pDelete($q, 'iii', $owner ? $owner : $session->id, $object_id, $type);
}
示例2: removeFromGroup
public static function removeFromGroup($user_id, $grp_id)
{
$q = 'DELETE FROM ' . self::$tbl_name . ' WHERE groupId = ? AND userId = ?';
Sql::pDelete($q, 'ii', $grp_id, $user_id);
return true;
}
示例3: deleteByReference
public static function deleteByReference($type, $reference)
{
$q = 'DELETE FROM ' . self::$tbl_name . ' WHERE type = ? AND reference = ?';
return Sql::pDelete($q, 'ii', $type, $reference);
}
示例4: gc
/** Garbage Collection */
public function gc($maxlifetime)
{
$q = 'DELETE FROM tblSessionData WHERE expires < NOW()';
Sql::pDelete($q);
return true;
}
示例5: deleteById
public static function deleteById($id, $tblname, $field_name = 'id')
{
if (!is_alphanumeric($tblname) || !is_alphanumeric($field_name)) {
throw new \Exception('very bad');
}
if (!is_numeric($id)) {
throw new \Exception('bad data' . $id);
}
$q = 'DELETE FROM ' . $tblname . ' WHERE ' . $field_name . ' = ?';
Sql::pDelete($q, 'i', $id);
}
示例6: delete
public static function delete($type, $owner, $name)
{
$q = 'DELETE FROM ' . self::$tbl_name . ' WHERE owner = ? AND type = ? AND name = ?';
Sql::pDelete($q, 'iis', $owner, $type, $name);
return true;
}
示例7: deleteByRoom
/**
* Removes all chat messages from a chatroom
*/
public static function deleteByRoom($id)
{
$q = 'DELETE FROM ' . self::$tbl_name . ' WHERE room = ?';
Sql::pDelete($q, 'i', $id);
}