Your idea is not a bad solution in this case. Because your game is turn based, the amount of time it takes to do a database search shouldn't be noticeable. Because you are checking in a PHP script, which I assume is not constantly running, you can't keep the map data in memory at all times so storing it on the file system is the other solution (unless you want to use a in-memory database like Redis). If you want to ensure that the database lookup is quick...make sure the primary key is the index of the tile. To calculate the index of the tile, use the formula:
x + (y*mapWidth) where mapWidth is the number of tiles in each row and x/y is the position of the tile in the grid. If you don't want to store the tile data per-row (I would recommend against storing each tile in a table row) you can store map data in a text blob as a comma-separated list of all the tiles, then convert that to an array and search by the index.