title: Can I just SELECT one column in MYSQL instead of all, to make it faster?
body: <p>I want to do something like this:</p>
  
  <pre><code>$query=mysql_query("SELECT userid FROM users WHERE username='$username'");
  $the_user_id= .....
  </code></pre>
  
  <p>Because all I want is the user ID that corresponds to the username.</p>
  
  <p>The usual way would be that:</p>
  
  <pre><code>$query=mysql_query("SELECT * FROM users WHERE username='$username'");
  while ($row = mysql_fetch_assoc($query))
      $the_user_id= $row['userid'];
  </code></pre>
  
  <p>But is there something more efficient that this?
  Thanks a lot, regards</p>