tags:

views:

527

answers:

2

Can anyone give me some suggestion please. In ASP we can use datalist and repeater control to repeate the rows but how can we do similar in php. I am designing a private message page for the similair as inbox page. Please can anyone help me.

A: 

Take a look at Smarty. It has {foreach} construct.

Pavel Chuchuva
+2  A: 

Use a loop construct. For example:

<?php foreach ($rows as $row): ?>
  <tr>
    <td><?php echo htmlspecialchars($row['id']); ?></td>
    <td><?php echo htmlspecialchars($row['name']); ?></td>
    <td><?php echo htmlspecialchars($row['email']); ?></td>
  </tr>
<?php endforeach; ?>
troelskn