title: Is there a way in MySQL to reverse a boolean field with one query?
body: <p>I have a column in my table titled 'authorised'. Its default is 0. It needs to be changed to 1 when the user is authorised, but it must be able to be reset to 0. I know I could do this easily with 2 queries like so:</p>
  
  <pre><code>$authorised = Db::query('SELECT authorised FROM users WHERE id=2');
  
  $newAuthValue = ($authorised['authorised']) ? 0 : 1;
  
  Db::query('UPDATE users SET authorised=' . $newAuthValue . ' WHERE id=2');
  </code></pre>
  
  <p>What I wanted to know, is there a way to do this with one query? To reverse a boolean value? </p>