title: SELECT and INSERT if true in the same query
body: <p>Is it possible to first SELECT from DB and then if something is true INSERT into db within the same query?</p>
  
  <p>Here is how I do right now:</p>
  
  <pre><code>$sql = mysql_query("SELECT * FROM ".$prefix."_active_users WHERE userid = $playerid AND DATE(timestamp) = '$sel_tag'");
  $row = mysql_fetch_assoc($sql);
  
  if(!$row){
       mysql_query("INSERT INTO ".$prefix."_active_users (userid,timestamp) VALUES ($playerid,'$now')");
  }
  </code></pre>
  
  <p>Hoping for help and thanks ;-)</p>