本文整理汇总了PHP中DBConnector::delUser方法的典型用法代码示例。如果您正苦于以下问题:PHP DBConnector::delUser方法的具体用法?PHP DBConnector::delUser怎么用?PHP DBConnector::delUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBConnector
的用法示例。
在下文中一共展示了DBConnector::delUser方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DBConnector
<?php
// Copyright (C) 2014 Universitätsbibliothek Mannheim
// See file LICENSE for license details.
// Datenbankanbindung initialisieren.
require_once 'DBConnector.class.php';
$dbcon = new DBConnector();
session_start();
if (isset($_SESSION['username'])) {
$username = $_SESSION['username'];
$dbcon->delUser($username, $dbcon->ipAddress());
}
session_destroy();
header('Location: index.php');
/*
// Alternate code, currently unused, not working with Apache2 proxy.
$hostname = $_SERVER['HTTP_HOST'];
$path = dirname($_SERVER['PHP_SELF']);
header('Location: http://'.$hostname.($path == '/' ? '' : $path).'/login.php');
*/
示例2: count
//~ $db->exec("CREATE TRIGGER dbchange AFTER UPDATE ON user
//~ BEGIN
//~ dbModifiedCallback();
//~ END");
//~ $db = new DBConnector('palma.db');
echo "Tables=" . $db->querySingle('SELECT count(*) FROM sqlite_master WHERE type="table"') . "\n";
var_dump($db->query("SELECT * from sqlite_master"));
$address = $db->ipAddress();
$db->addUser('testuser1', $address);
//~ $db->addUser('testuser2', $address);
//~ $db->addUser('testuser3', $address);
//~ $db->addUser('testuser4', $address);
$users = $db->getUsers();
$db->enableUser('testuser1');
var_dump($users);
$db->delUser('haenger', $address);
$db->delUser('ivwz', $address);
$db->delUser('skrieg', $address);
$db->delUser('testuser1', $address);
$db->delUser('testuser2', $address);
$db->delUser('testuser3', $address);
$db->delUser('testuser4', $address);
echo "Query=" . $db->querySingle('select name from user') . "\n";
echo "Query=" . $db->querySingle('select count(name) from user') . "\n";
echo "Query=" . $db->querySingle('select value from setting where key="layout"') . "\n";
$db->close();
//~ $db = new DBConnector('palma.db');
//~ $users = $db->getUsers();
//~ var_dump($users);
//~ $db->close();
}