In my game, I need to move a pawn from one square on the board to another. So far, the only way I've gotten this to work, is via two separate database updates:
Is there any way to combine these two queries into a single one? I'm more concerned with atomicity, but it would probably have better performance too.
- UPDATE board SET board_player=NULL WHERE ( board_row = 6 AND board_col = 1 )
- UPDATE board SET board_player='2321571' WHERE ( board_row = 6 AND board_col = 3 )
Is there any way to combine these two queries into a single one? I'm more concerned with atomicity, but it would probably have better performance too.