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.
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.
This is what I have right now, and I am getting an error:
Unknown column 'password' in 'field list'
Here is my code
$loggin_user = $_COOKIE['username'];
$query = "SELECT password FROM users WHERE username = $loggin_user";
$result = mysql_query($query) or die($query."<br/><br/>".mysql_error());
$password = mysql_result($result, 0);
echo $password;
For the sake of this question, password is 'password'. When echoing $password, I should see 'password'. But nothing.
I am able to write to the database and everything. I am also including a db.php which has my database info for connecting.
Any help would be great.