title: PHP & MySQL Search Column for value
body: <p>I am a little confused about how <code>$query</code> works and how I can find a value... Say I have a <code>checkuser.php</code> script. The purpose here is to <code>echo</code> "Correct" if the user already exists. I have the columns (username, password, email). What I want to know is how can I search the column <code>username</code> for value <code>$username</code>? This is what I have currently:</p>
  
  <pre><code>$query = sprintf("SELECT * FROM users WHERE CONCAT(username) LIKE '$u'");
  $result = mysql_query($query);
  if(mysql_num_rows($result) != 1)
  echo "Username Not Found";
  </code></pre>
  
  <p>Thanks!</p>