title: How to echo data from id
body: <p>I assume this must be simple, but I'm just stuck on a solution here. How would I echo data from the id in the database? I cannot edit the css div where I display this data so need to find out a way to cut down the PHP, for example:</p>
  
  <pre><code>&lt;?  $query = "SELECT * FROM example WHERE id='1'";
  
          $result_1 = mysql_query("SELECT * FROM example WHERE id=1");
          $result_2 = mysql_query("SELECT * FROM example WHERE id=2");
          $result_3 = mysql_query("SELECT * FROM example WHERE id=3");
  
  
  
          while($row_1 = mysql_fetch_array($result_1))
          while($row_2 = mysql_fetch_array($result_2))
          while($row_3 = mysql_fetch_array($result_3))
  
  
            { ?&gt;
  </code></pre>
  
  <p>From here I echo the data in a div:</p>
  
  <pre><code>&lt;? echo $row_1['name'] ?&gt;
  </code></pre>
  
  <p>What I am trying to do is something like this: echo $row_1['name']['1']. I want to somewhat use the WHERE id=1 inside my echo. Sorry if this is not clear. </p>
  
  <p>Thanks</p>