title: how to print records in tpl file in smarty?
body: <p>How to print the records array in the tpl file?
  This is my php code:</p>
  
  <pre><code>$inbox=mysql_query("SELECT * FROM table1");
    $inbox_rec=array();
    while($inbox_data=mysql_fetch_assoc($inbox))
    {
        $sent_mail_id = 12;
        array_push($inbox_rec,$inbox_data);
        $send=mysql_query("SELECT * FROM table2 where id = '$sent_mail_id'");
        $i=0;
        while($send_data=mysql_fetch_assoc($send))
        {
          array_push($inbox_rec[$i],$send_data);
        }
        $i++;
  
    }
    $smarty-&gt;assign(array("inbox_rec"=&gt;$inbox_rec));
  </code></pre>
  
  <p>I want to view the records in tpl file as I have used the code in tpl file as shown below: </p>
  
  <pre><code>{foreach $inbox_rec as $value}
               &lt;table class="table table-responsive"&gt;
               &lt;tbody&gt;
                 &lt;tr&gt;
                 &lt;td align="left"&gt;
                 &lt;h5  style="color:#426AD5;"&gt;&lt;b&gt;{$value.mail_name}&lt;/b&gt;&lt;/h5&gt;
                 &lt;h5  style="color:#426AD5;"&gt;&lt;b&gt;{$value.mail_email}&lt;/b&gt;&lt;/h5&gt;
                 &lt;h5  style="color:#595959;"&gt;&lt;b&gt;{$value.mail_msg}&lt;/b&gt;&lt;/h5&gt;&lt;br /&gt;
                 {foreach inbox_rec as $detail}
  
                 &lt;h5  style="color:#426AD5;"&gt;&lt;b&gt;Admin&lt;/b&gt;&lt;/h5&gt;
                 &lt;h5  style="color:#595959;"&gt;&lt;b&gt;{$detail[$i].sent_mail_msg}&lt;/b&gt;&lt;/h5&gt;&lt;br /&gt;
  
                 {/foreach}
  {/foreach}
  </code></pre>