I'm sure there is a better way to do it, but I would think the simplest solution would be to start from the center and have an x and y offset for each square reaching out from there.
Center is 0,0 - Square to the right is 0,1, etc.
Then you store xoffset, yoffest, and tile value in a database as squares are filled in.
Center is 0,0 - Square to the right is 0,1, etc.
Then you store xoffset, yoffest, and tile value in a database as squares are filled in.