title: How can I assign to a variable a value from a database table in PHP
body: <p>How can I assign to a variable a value from a database table in PHP. All I found didn't work at all. They were full of errors I try to fix them because that was old php code but I have at least one error left :(.</p>
  
  <p>So I have a database named authentication, a table named users, a column from that table is called coins and I want to assign to a variable the value of coins from a specific username which I have on a global variable <code>$_SESSION['username']</code> for use in the <code>WHERE username = "'$_SESSION['username']'"</code> (username is also a column from the table).</p>