title: PHP - MySQL select, from, where
body: <p>I am having some difficulties selecting a field in a row. Perhaps someone can point me into the correct direction to read some proper documentation, I am pretty new at this. </p>
  
  <p>I have a table called users where I have a row with a username set to ryanjay.  I am trying to select the password from this row.</p>
  
  <p>This is what I have right now, and I am getting an error: </p>
  
  <blockquote>
    <p>Unknown column 'password' in 'field list'</p>
  </blockquote>
  
  <p>Here is my code</p>
  
  <pre><code>$loggin_user = $_COOKIE['username'];
  
  $query = "SELECT password FROM users WHERE username = $loggin_user";
  $result = mysql_query($query) or die($query."&lt;br/&gt;&lt;br/&gt;".mysql_error());
  $password = mysql_result($result, 0);
  echo $password;
  </code></pre>
  
  <p>For the sake of this question, password is 'password'.  When echoing $password, I should see 'password'. But nothing. </p>
  
  <p>I am able to write to the database and everything.  I am also including a db.php which has my database info for connecting.  </p>
  
  <p>Any help would be great.  </p>