title: more efficient way to display single value from mySQL db?
body: <p>I Am just learning PHP and loving it so far. I have this code that is pulling a single random ID from a database, but the only way I know how to do it is with a while loop which seems not very efficient.  Can anybody show me how to spice up this code?  As you can see, I am just trying to assign $pollquestionid a random active ID from the DB.</p>
  
  <pre><code>///this gets a random active poll number
      $sql12 = "SELECT id FROM poll WHERE removed = 0 AND active = 1 ORDER BY RAND() LIMIT 1";
      $result12 = mysql_query($sql12);
      while ($myrow12 = mysql_fetch_array($result12)) {
      $pollquestionid = $myrow12['id'];
      }
  </code></pre>
  
  <p>Thanks in advance!</p>