title: PHP MySQL query variables not returning
body: <p>I store my testimonials in a database table and would like them to be displayed on my website via this for loop:</p>
  
  <pre><code>&lt;?php
  
  $count = mysql_fetch_assoc(mysql_query("SELECT COUNT(*) cnt FROM testimonials"));
  
  for ($i = 1; $i &lt;= intval($count['cnt']); $i++)
  {
      $sql = mysql_query("SELECT * FROM testimonials WHERE id='{$i}'");
      ?&gt;
      &lt;li class="span4"&gt;
          &lt;div class="thumbnail thumbnail-1"&gt;
              &lt;section&gt; 
                  &lt;a class="link-1" style="cursor:pointer;"&gt;&lt;?php echo $sql['name'] ?&gt;&lt;/a&gt;
                  &lt;p&gt;&lt;?php echo $sql['text'] ?&gt;&lt;/p&gt;
                  &lt;a href="http:// &lt;?php echo $sql['product'] ?&gt; /" class="link-1"&gt;&lt;?php echo $sql['product'] ?&gt;&lt;/a&gt;
              &lt;/section&gt;
          &lt;/div&gt;
      &lt;/li&gt;
  
      &lt;?php
  }
  
  ?&gt;
  </code></pre>
  
  <p>The issue is that the $sql variables product, name and text are not displaying. However the $count is getting the correct intval, so it knows there are entries.</p>
  
  <p>It's also worth pointing out that the loop is working as I get the <code>&lt;li&gt;</code> <code>&lt;div&gt;</code> and <code>&lt;section&gt;</code> tags working, the only issue is the <code>&lt;a&gt;</code>'s and the <code>&lt;p&gt;</code> not getting the textual value from the <code>echo</code></p>
  
  <p>P.S. I know that <code>mysql_*</code> functions are depreciated however my php version 5.3 and they are only depreciated from 5.5 so they are ok for my website.</p>