table exists
@param  string $table can be table|prefix_table|dbname.table
@return boolean
6118
public function tableExists($table)
    {
        $database = null;
        if (($pos = strpos($table, '.')) !== false) {
            $database = substr($table, 0, $pos);
            $table = substr($table, $pos + 1);
        } else {
            $table = $this->buildRealTableName($table, false);
        }
        
        $tables = $this->getTables($database);
        
        return in_array($table, $tables);
    }
604429
public function tableExists($table, $parse = true)
    {
        // prepare
        if ($parse) {
            $table = $this->getPrefix($table);
        }

        // escape table name for query
        $escapedTable = str_replace('_', '\\_', $table);

        // sql query to test if table exists
        $sql = "SHOW TABLES LIKE '{$escapedTable}'";

        // execute test if table exists
        $exists = $this->getRow($sql);

        return (bool) $exists;
    }
816059
protected function getTableDatabase($table)
    {
        if (!array_key_exists($table, $this->tables)) {
            return false;
        }

        $database = $this->tables[$table];

        # If this table's database depends on the mode
        if (is_array($database)) {
            if (array_key_exists($this->mode, $database)) {
                $database = $database[$this->mode];
            } else {
                $database = $database["default"];
            }
        }

        return $database;
    }
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));
  }
945220
public function tableExists($tableName)
    {
        $sm = $this->getSchemaManager();
        $schemaTables = $sm->listTableNames();

        return in_array(strtolower($tableName), array_map('strtolower', $schemaTables));
    }
461712
public function exists(): bool
    {
        $tableKey = $this->getKeyName();

        //If key isn't set we cant associate this record with DB
        if (! isset($this->$tableKey))
        {
            return false;
        }

        $sql = 'SELECT EXISTS(SELECT ' . $tableKey . ' FROM ' . $this->getTableName() . ' WHERE ' . $this->getKeyName() . ' = :key LIMIT 1)';
        $query = DB::getConnection()->prepare($sql);
        $query->execute(['key' => $this->getKey()]);

        return boolval($query->fetchColumn(0));
    }
270493
public function TableExists($TableName = NULL) {
      if($this->_TableExists === NULL || $TableName !== NULL) {
         if ($TableName === NULL)
            $TableName = $this->TableName();

         if(strlen($TableName) > 0) {
            $Tables = $this->Database->SQL()->FetchTables(':_'.$TableName);
            $Result = count($Tables) > 0;
         } else {
            $Result = FALSE;
         }
         if ($TableName == $this->TableName())
            $this->_TableExists = $Result;
         return $Result;
      }
      return $this->_TableExists;
   }
169957
public function dropTable($table)
    {
    	if(!$this->hasTable($table)) {
    		return hst_message('is has table');
    	}
        \Schema::connection($this->databaseName)->drop($table);
		return true;
    }
266257
public function ImportExists($Table, $Column = '') {
      if(!array_key_exists('Tables', $this->Data) || !array_key_exists($Table, $this->Data['Tables']))
         return false;
      if(!$Column)
         return TRUE;
      $Tables = $this->Data['Tables'];

      $Exists = GetValueR("Tables.$Table.Columns.$Column", $this->Data, FALSE);
      return $Exists !== FALSE;
   }
399658
public function matches( $table ) {

		global $wpdb;

		$_table = $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $table ) );

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

        return $result !== false;
    }
963885
protected function _tableExists($table)
    {
        $db = ConnectionManager::get('default');
        $tables = $db->schemaCollection()->listTables();

        return in_array($table, $tables);
    }
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();
			}
		}

	}
219456
public function exists()
    {
        $sql = 'SELECT count(*) FROM INFORMATION_SCHEMA.TABLES WHERE Table_Name=? ';
        $params = array($this->_name->table);

        if (is_null($this->_name->database)) {
            $sql .= 'AND TABLE_SCHEMA=database() ';
        } else {
            $sql .= 'AND TABLE_SCHEMA=? ';
            $params []= $this->_name->database;
        }

        return (bool) $this->_connection->execute($sql, $params)->scalar();
    }
1373900
public function checkTableExist($table, $con=NULL)
    {
        $connection = $this->checkConnection($con);
        $query = $connection->query("SELECT 1 FROM {$table} LIMIT 1");
        if($query !== false)
        {
            return true;
        }
    }
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');
   }
584834
public function hasTable($table)
	{
            $sql = $this->grammar->compileTableExists($table);
            $statement = $this->connection->getBatchQuery($sql, []);
            $data = $statement->getResultSet();
            return $data->result()? true: false;
          
	}