title: Get a name from a database using the id of the same row. In PHP
body: <p>Im very new to php and i want to try and get a name from a database by using the id number.
  Eg id=1 name=test
  i want to say when id=1 make name=test
  I thought this would do it, I have been trying make up the php myself. Rather than follow specific tutorials. Im assuming what i want to do is very commonly done but i cant understand where my code is going wrong.</p>
  
  <pre><code>$id = "1"; // later i will add it so this is defined by the link you click on
  $firstname = mysql_query("SELECT firstname FROM $info_table WHERE id = $id");
  $secondname = mysql_query("SELECT secondname FROM $info_table WHERE id = $id"); 
  $name = $firstname $secondname;`
  echo name;
  </code></pre>
  
  <p>the table is $info_table and then the firstname and secondname parts are the columns. Is that how it should be or not?</p>
  
  <p>Anyone help clear up my confusion. </p>