diff --git a/wire/core/WireDatabasePDO.php b/wire/core/WireDatabasePDO.php index 1e22e1af..8a43b605 100644 --- a/wire/core/WireDatabasePDO.php +++ b/wire/core/WireDatabasePDO.php @@ -593,6 +593,23 @@ class WireDatabasePDO extends Wire implements WireDatabase { return $tables; } + /** + * Does the given table exist in this database? + * + * #pw-group-custom + * + * @param string $table + * @return bool + * @since 3.0.133 + * + */ + public function tableExists($table) { + $query = $this->prepare('SHOW TABLES LIKE ?'); + $query->execute(array($table)); + $result = $query->fetchColumn(); + return !empty($result); + } + /** * Is the given string a database comparison operator? *