Checks if a table exists.

@param string $table table name

@return bool TRUE if table exists, else FALSE
2075
public function tableExists( $table )
    {
        $query = "SELECT COUNT(*) AS count FROM information_schema.tables
                  WHERE table_schema = ? AND table_name = ?";

        $params = [ $this->name, $table ];

        $statement = $this->database->prepare( $query );
        $statement->execute( $params );

        $results = $statement->fetchAll();

        return ( 0 < ( int ) $results[ 0 ][ 'count' ] );
    }
313287
def _table_exists(self):
        """"""
        self.cursor.execute("SHOW TABLES")
        for table in self.cursor.fetchall():
            if table[0].lower() == self.name.lower():
                return True
        return False
1081744
public static function doesTableExist($table) {
		try {
			fw\Database::prepare("SELECT 1 FROM {$table}")->fetchOne();
			return true;
		} catch (\PDOException $ex) {
			return false;
		}
	}
1275293
protected function _seeTableInDatabase($table)
    {
        $dbh = $this->_getDbh();
        $sth = $dbh->prepare('SHOW TABLES LIKE :table');
        $this->debugSection('Query', $sth->queryString);
        $sth->execute(['table' => $table]);
        $count = $sth->rowCount();

        return $count == 1;
    }
920756
def has_table(self, table):
        
        sql = self._grammar.compile_table_exists()

        table = self._connection.get_table_prefix() + table

        return len(self._connection.select(sql, [table])) > 0
154208
public boolean tableExists(String table)
		throws SQLException
	{

		PreparedStatement statement = null;
		ResultSet result = null;
		try {
			statement = this.connection.prepareStatement("SHOW TABLES;");
			result = execute(statement);

			if (result == null) {
				return false;
			}
			boolean found = false;
			while(result.next()){
					if(table.equalsIgnoreCase(result.getString(1))){
						found = true;
					}
			}
			return found;

		}
		finally {
			if (statement != null) {
				statement.close();
			}
			if (result != null) {
				result.close();
			}
		}

	}
451795
public function checkTableExists(string $tableName): bool
    {
        try {
            $result = $this->pdo->query("SELECT 1 FROM $tableName LIMIT 1");
        } catch (\Exception $e) {
            return false;
        }

        return $result !== false;
    }
1179351
public function tableExists($table)
    {
        try {
            $result = $this->query("SELECT 1 FROM `{$table}` LIMIT 1");
        } catch (\Exception $e) {
            return false;
        }

        return $result !== false;
    }
1247797
public function EmptyTable($Table = '') {
      if ($Table == '') {
         if (!isset($this->_Froms[0]))
            return FALSE;

         $Table = $this->_Froms[0];
      } else {
         $Table = $this->EscapeIdentifier($this->Database->DatabasePrefix.$Table);
      }


      $Sql = $this->GetDelete($Table);
      
      return $this->Query($Sql, 'delete');
   }
810498
protected function detectRelationTable($table): bool
    {
        $foreignKeys = $table->getForeignKey();
        if (count($foreignKeys) != 2) {
            return false;
        }
        $tables = [];
        foreach ($foreignKeys as $foreignKey) {
            if (!$foreignKey->hasMany()) {
                return false;
            }
            $tables[] = $foreignKey->getReferenceTableName();
        }
        if ($table->getName() === implode('_', [singularize($tables[0]), $tables[1]])
            || $table->getName() === implode('_', [singularize($tables[1]), $tables[0]])) {
            return true;
        }

        return false;
    }
178776
def is_table_existed(self, tablename):
        
        all_tablenames = self.list_tables()
        tablename = tablename.lower()

        if tablename in all_tablenames:
            return True
        else:
            return False
49723
def HasTable(self, table_name):
    
    if not self._connection:
      raise RuntimeError(
          'Cannot determine if table exists database not opened.')

    sql_query = self._HAS_TABLE_QUERY.format(table_name)

    self._cursor.execute(sql_query)
    if self._cursor.fetchone():
      return True

    return False
723609
protected function tableExists($tableName)
    {
        $found    = false;
        $iterator = $this->dynamoDb->getClient()->getIterator('ListTables');
        foreach ($iterator as $table) {
            if ($table === $tableName) {
                $found = true;
            }
        }

        return $found;
    }
526562
protected function tableExistsReadinessCheck($database, $table)
    {
        $url = $this->config->get('URL');
        $dbc = $this->connection;
        $dbc->selectDB($database);
        if (!$dbc->tableExists($table)) {
            $this->error_text = "<p>Missing table {$database}.{$table}
                            <br /><a href=\"{$url}install/\">Click Here</a> to
                            create necessary tables.</p>";
            return false;
        }

        return true;
    }
867251
public static function hasTable($tableName)
    {
        // Cache the list of all table names to reduce on DB traffic
        if (empty(self::$_cache_all_tables) && DB::is_active()) {
            self::$_cache_all_tables = DB::get_schema()->tableList();
        }
        return !empty(self::$_cache_all_tables[strtolower($tableName)]);
    }
37785
public static function checkTableExists(string $tableName): bool
  {
    $query = sprintf('
select 1
from   information_schema.TABLES
where table_schema = database()
and   table_name   = %s', self::$dl->quoteString($tableName));

    return !empty(self::executeSingleton0($query));
  }
1156965
protected function checkTable(string $table)
    {
        if (!in_array($table, [RoomContract::ROOMS_KEY, RoomContract::DESCRIPTORS_KEY])) {
            throw new InvalidArgumentException("Invalid table name: `{$table}`.");
        }
    }