fix typo, db-weiche wieder entfernt

This commit is contained in:
bernd 2021-03-20 00:40:34 +01:00
parent 0483ceab53
commit a80da9dab8

View file

@ -158,15 +158,9 @@ class Database {
*/
$this->log->d("Check if table requests exists");
if ($this->pdo->driver === "PDO_PGSQL") {
$stmt = "SELECT * FROM information_schema.tables WHERE
table_type = 'BASE TABLE' and
table_name = 'requests'";
} else if ($this->pdo->driver === "PDO_PSQLITE") {
// ungetestet
$stmt = "SELECT 1 FROM sqlite_master WHERE type='table' and
name='requests'";
}
$stmt = "SELECT * FROM information_schema.tables WHERE
table_type = 'BASE TABLE' and
table_name = 'requests'";
try {
$response = $this->pdo->query($stmt);
} catch (PDOException $e) {
@ -234,7 +228,7 @@ class Database {
$userFound = false;
$users = [];
$this->log->d("Search for localpart {$nick} in users");
$query = "SELECT `name` FROM users WHERE `name` = :nick";
$query = "SELECT name FROM users WHERE name = :nick";
$name = "@" . $nick . ":matrix.kraut.space";
$users = $this->searchUser($query, $name);
$count = count($users);
@ -321,7 +315,7 @@ class Database {
$this->log->i("Search for IP: {$_SERVER['REMOTE_ADDR']}");
$stmt = $this->pdo->prepare(
"SELECT `time` FROM requests WHERE ip = :ip"
"SELECT time FROM requests WHERE ip = :ip"
);
try {
$stmt->BindValue(':ip', $ip, PDO::PARAM_LOB);