本文整理汇总了PHP中rex_sql::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP rex_sql::delete方法的具体用法?PHP rex_sql::delete怎么用?PHP rex_sql::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rex_sql
的用法示例。
在下文中一共展示了rex_sql::delete方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
function a724_deletePathnamesFromTable()
{
$debug = false;
// Alle Urls der Tabelle loeschen
$sqld = new rex_sql();
$sqld->setDebug($debug);
$sqld->setTable('rex_a724_frau_schultze');
$sqld->setWhere('name != "" AND url_table != "" AND url_table_parameters = ""');
$sqld->delete();
}
示例2: asd_news_deleteClang
function asd_news_deleteClang($params)
{
$id = $params['id'];
$name = $params['name'];
$sql = new rex_sql();
$sql->setTable(rex_asd_news_config::getTable());
$sql->setWhere('`clang`= ' . $id);
if ($sql->delete()) {
echo rex_info('ASD News: Neuigkeiten wurden gelöscht');
} else {
echo rex_warning('<b>ASD News Fehler:</b> Neuigkeiten aus der Sprache "' . $name . '" konnte nicht gelöscht werden');
}
}
示例3: getInsertValue
function getInsertValue($value)
{
$value = (array) $value;
$section =& $this->getSection();
// Alle vorhanden Werte löschen
$sql = new rex_sql();
$sql->setTable($this->foreignTable);
$sql->setWhere($section->_getWhereString());
$sql->delete();
// und anschließend alle neu eintragen
foreach ($value as $val) {
// Parameter aus der Ursprungstabelle mit abspeichern damit später darüber verknüpft werden kann
foreach ($section->getWhere() as $whereColName => $whereColValue) {
$sql->setValue($whereColName, $whereColValue);
}
// Den zu speichernden Wert
$sql->setValue($this->foreignField, $val);
$sql->setTable($this->foreignTable);
$sql->insert();
}
// null zurückgeben, damit zu diesem Feld nichts im rexForm gespeichert wird
return null;
}
示例4: deleteCache
/**
* Truncates the cache or deletes all data that are concerned with the given index-ids.
*
* @param mixed $_indexIds
*
*
*/
function deleteCache($_indexIds = false)
{
if ($_indexIds === false) {
// delete entire search-chache
$delete = new rex_sql();
$delete->setTable($this->tablePrefix . '587_searchcacheindex_ids');
$delete->delete();
$delete2 = new rex_sql();
$delete2->setTable($this->tablePrefix . '587_searchcache');
$delete2->delete();
} elseif (is_array($_indexIds) and !empty($_indexIds)) {
$sql = new rex_sql();
$query = sprintf('
SELECT cache_id
FROM %s
WHERE index_id IN (%s)', $this->tablePrefix . '587_searchcacheindex_ids', implode(',', $_indexIds));
$deleteIds = array(0);
foreach ($sql->getArray($query) as $cacheId) {
$deleteIds[] = $cacheId['cache_id'];
}
// delete from search-cache where indexed IDs exist
$delete = new rex_sql();
$delete->setTable($this->tablePrefix . '587_searchcache');
$delete->setWhere('id IN (' . implode(',', $deleteIds) . ')');
$delete->delete();
// delete the cache-ID and index-ID
$delete2 = new rex_sql();
$delete2->setTable($this->tablePrefix . '587_searchcacheindex_ids');
$delete2->setWhere('cache_id IN (' . implode(',', $deleteIds) . ')');
$delete2->delete();
// delete all cached searches which had no result (because now they maybe will have)
$delete3 = new rex_sql();
$delete3->setTable($this->tablePrefix . '587_searchcache');
$delete3->setWhere(sprintf('id NOT IN (SELECT cache_id FROM `%s`)', $this->tablePrefix . '587_searchcacheindex_ids'));
$delete3->delete();
}
}
示例5:
$status = $sql->getValue('status') ? 0 : 1;
$sql->setTable(rex_asd_news_config::getTable());
$sql->setWhere('id=' . $id . ' AND clang = ' . $clang);
$sql->setValue('status', $status);
if ($sql->update()) {
echo rex_info($I18N->msg('asd_news_status_saved'));
} else {
echo rex_warning($sql->getError());
}
$func = '';
}
if ($func == 'delete') {
$sql = new rex_sql();
$sql->setTable(rex_asd_news_config::getTable());
$sql->setWhere('id=' . $id . ' AND clang = ' . $clang);
if ($sql->delete()) {
echo rex_info($I18N->msg('asd_news_deleted'));
} else {
echo rex_warning($sql->getError());
}
$func = '';
}
if ($func == 'unpublish') {
$sql = new rex_sql();
$sql->setTable(rex_asd_news_config::getTable());
$sql->setWhere('id=' . $id . ' AND clang = ' . $clang);
$sql->setValue('publishedAt', '0000-00-00 00:00:00');
$sql->setValue('publishedBy', 0);
$successMessage = $I18N->msg('asd_news_unpublished_s');
if (rex_asd_news_config::getConfig('published-lang') == 'all') {
$sql->setWhere('`id` = ' . $id);
示例6: elseif
if (!empty($add_action)) {
$action = new rex_sql();
$action->setTable($REX['TABLE_PREFIX'] . 'module_action');
$action->setValue('module_id', $modul_id);
$action->setValue('action_id', $action_id);
if ($action->insert()) {
$message = $I18N->msg('action_taken');
$goon = 'ja';
} else {
$message = $action->getErrro();
}
} elseif (isset($function_action) and $function_action == 'delete') {
$action = new rex_sql();
$action->setTable($REX['TABLE_PREFIX'] . 'module_action');
$action->setWhere('id=' . $iaction_id . ' LIMIT 1');
$message = $action->delete($I18N->msg('action_deleted_from_modul'));
}
// ---------------------------- FUNKTIONEN FÜR MODULE
$module_in_use_message = '';
if ($function == 'delete') {
$del = new rex_sql();
$del->setQuery("SELECT " . $REX['TABLE_PREFIX'] . "article_slice.article_id, " . $REX['TABLE_PREFIX'] . "article_slice.clang, " . $REX['TABLE_PREFIX'] . "article_slice.ctype, " . $REX['TABLE_PREFIX'] . "module.name FROM " . $REX['TABLE_PREFIX'] . "article_slice\r\n LEFT JOIN " . $REX['TABLE_PREFIX'] . "module ON " . $REX['TABLE_PREFIX'] . "article_slice.modultyp_id=" . $REX['TABLE_PREFIX'] . "module.id\r\n WHERE " . $REX['TABLE_PREFIX'] . "article_slice.modultyp_id='{$modul_id}' GROUP BY " . $REX['TABLE_PREFIX'] . "article_slice.article_id");
if ($del->getRows() > 0) {
$modulname = htmlspecialchars($del->getValue($REX['TABLE_PREFIX'] . "module.name"));
for ($i = 0; $i < $del->getRows(); $i++) {
$aid = $del->getValue($REX['TABLE_PREFIX'] . "article_slice.article_id");
$clang_id = $del->getValue($REX['TABLE_PREFIX'] . "article_slice.clang");
$ctype = $del->getValue($REX['TABLE_PREFIX'] . "article_slice.ctype");
$OOArt = OOArticle::getArticleById($aid, $clang_id);
$label = $OOArt->getName() . ' [' . $aid . ']';
if (count($REX['CLANG']) > 1) {
示例7: implode
// Allgemeine Funktionen aufrufen bei Listenansicht (Offline stellen etc.)
switch ($func) {
case 'setstatus':
$oid = rex_request('oid', 'int');
$statusfield = rex_request('statusfield', 'string');
$oldstatus = rex_request('oldstatus', 'int');
$minstatus = rex_request('minstatus', 'int', 0);
$maxstatus = rex_request('maxstatus', 'int');
if (setStatus(TBL_NEWS, $oid, $statusfield, $oldstatus, $minstatus, $maxstatus)) {
echo rex_info('Statusupdate erfolgreich');
} else {
echo rex_warning('Statusupdate nicht erfolgreich');
}
$func = '';
break;
case 'delete':
$postparams = implode(",", $_POST['ids']);
$sql = new rex_sql();
$sql->setTable(TBL_NEWS);
$sql->setWhere('id IN (' . $postparams . ')');
$success = $sql->delete();
if ($sql->getRows() > 0) {
echo rex_info('Die Datensätze wurden gelöscht');
} else {
echo rex_warning('Die Datensätze konnten nicht gelöscht werden');
}
$func = '';
break;
}
require $file;
require $REX['INCLUDE_PATH'] . "/layout/bottom.php";
示例8: removeLanguageData
/**
* @param $clang
* @return bool
*/
public static function removeLanguageData($clang)
{
global $REX;
$sql = new rex_sql();
$sql->setTable($REX['TABLE_PREFIX'] . 'global_settings');
$sql->setWhere('clang = ' . (int) $clang);
return $sql->delete();
}
示例9: elseif
if ($add_action != "") {
$action = new rex_sql();
$action->setTable($REX['TABLE_PREFIX'] . 'module_action');
$action->setValue('module_id', $modul_id);
$action->setValue('action_id', $action_id);
if ($action->insert()) {
$info = $I18N->msg('action_taken');
$goon = '1';
} else {
$warning = $action->getErrro();
}
} elseif ($function_action == 'delete') {
$action = new rex_sql();
$action->setTable($REX['TABLE_PREFIX'] . 'module_action');
$action->setWhere('id=' . $iaction_id . ' LIMIT 1');
$info = $action->delete($I18N->msg('action_deleted_from_modul'));
}
// ---------------------------- FUNKTIONEN FÜR MODULE
if ($function == 'delete') {
$del = new rex_sql();
$del->setQuery("SELECT " . $REX['TABLE_PREFIX'] . "article_slice.article_id, " . $REX['TABLE_PREFIX'] . "article_slice.clang, " . $REX['TABLE_PREFIX'] . "article_slice.ctype, " . $REX['TABLE_PREFIX'] . "module.name FROM " . $REX['TABLE_PREFIX'] . "article_slice\r\n LEFT JOIN " . $REX['TABLE_PREFIX'] . "module ON " . $REX['TABLE_PREFIX'] . "article_slice.modultyp_id=" . $REX['TABLE_PREFIX'] . "module.id\r\n WHERE " . $REX['TABLE_PREFIX'] . "article_slice.modultyp_id='{$modul_id}' GROUP BY " . $REX['TABLE_PREFIX'] . "article_slice.article_id");
if ($del->getRows() > 0) {
$module_in_use_message = '';
$modulname = htmlspecialchars($del->getValue($REX['TABLE_PREFIX'] . "module.name"));
for ($i = 0; $i < $del->getRows(); $i++) {
$aid = $del->getValue($REX['TABLE_PREFIX'] . "article_slice.article_id");
$clang_id = $del->getValue($REX['TABLE_PREFIX'] . "article_slice.clang");
$ctype = $del->getValue($REX['TABLE_PREFIX'] . "article_slice.ctype");
$OOArt = OOArticle::getArticleById($aid, $clang_id);
$label = $OOArt->getName() . ' [' . $aid . ']';
if (count($REX['CLANG']) > 1) {