title: retrieve single row data in mysql using php
body: <p>I created a website that has multiple logins and unique informations to it.. i want to retrieve the data from one user. example my username is qwert and my password is 1234, I want to retrieve his unique information to the database. I used the sample code in <a href="http://www.w3schools.com/php/php_mysql_select.asp" rel="nofollow">w3schools</a> and it selects all the data but all I want to do is to retrieve the data from the user which is only logged in. </p>
  
  <p>can anyone help me about this? any help will be much appreciated.</p>
  
  <pre><code>mysql_select_db("xone_login", $con);
  
  $result = mysql_query("SELECT * FROM admin WHERE username = '$myusername' ");
  
  echo "&lt;table border='1'&gt;
  &lt;tr&gt;
  &lt;th&gt;Firstname&lt;/th&gt;
  &lt;th&gt;Lastname&lt;/th&gt;
  &lt;/tr&gt;";
  
  while($row = mysql_fetch_array($result))
    {
    echo "&lt;tr&gt;";
    echo "&lt;td&gt;" . $row['overtime'] . "&lt;/td&gt;";
    echo "&lt;td&gt;" . $row['daily_rate'] . "&lt;/td&gt;";
    echo "&lt;/tr&gt;";
    }
  echo "&lt;/table&gt;";
  
  mysql_close($con);
  ?&gt;
  </code></pre>