public function tableExists($tableName)
    {
        if (is_null($this->dbh)) {
            throw new NoConnectionException();
        }

        $mrSql  = "SHOW TABLES LIKE :table_name";
        $mrStmt = $this->dbh->prepare($mrSql);

        // protect from injection attacks
        $mrStmt->bindParam(":table_name", $tableName, \PDO::PARAM_STR);

        $sqlResult = $mrStmt->execute();

        if ($sqlResult) {
            $row = $mrStmt->fetch(\PDO::FETCH_NUM);

            if ($row[0]) {
                return true;
            }
        }

        return false;
    }