Fix columnExists query

This commit is contained in:
grandeljay 2022-11-09 11:37:28 +01:00
parent ab100ac5ce
commit 848572a709

View file

@ -74,12 +74,14 @@ class Database
public function columnExists(string $table_to_check, string $column_to_check): bool public function columnExists(string $table_to_check, string $column_to_check): bool
{ {
$result = $this->query( $result = $this
->query(
'SELECT * 'SELECT *
FROM `INFORMATION_SCHEMA`.`COLUMNS` FROM `INFORMATION_SCHEMA`.`COLUMNS`
WHERE TABLE_NAME = "' . $table_to_check . '" WHERE TABLE_NAME = "' . $table_to_check . '"
AND COLUMN_NAME = "' . $column_to_check . '"' AND COLUMN_NAME = "' . $column_to_check . '"'
); )
->fetch();
$exists = false !== $result; $exists = false !== $result;
return $exists; return $exists;