1) "select * from `union` WHERE `thanaId`='$thana_id'" // it's working
2) "select * from union WHERE thanaId='$thana_id'" // it's not working
The backtick encases the string to be treated as a string named literal rather than be interpreted by the MySQL engine. The word
union is a reserved / keyword and so MYSQL will be expecting a different syntax because it won't realise that you're using this word as a name identifier.
You would do very well to read and learn this page from the MySQL manual. Every word from the list on this page should be encased in backticks in MySQL queries if you want MySQL to treat it as a name.
It's also useful as much as possible to not name columns/tables with Keywords or reserved words!