Is it possible to somehow get structure of MySQL database, or just some table with simple query?
Or is there another way, how can I do it?
Take a look at the INFORMATION_SCHEMA.TABLES table. It contains metadata about all your tables.
Example:
SELECT * FROM `INFORMATION_SCHEMA`.`TABLES`
WHERE TABLE_NAME LIKE 'table1'
The advantage of this over other methods is that you can easily use queries like the one above as subqueries in your other queries.