Need help in printing records from database
I want to print records from db like this.
http://www.imagesup.net/dm-613781138202.png
I have tried for loop and foreach both.
The sample code is:
<?php
$str = '1,2,3,4,5,6,7,8,9,10,11,12,13,14';
$str2 = (explode(",",$str));
echo '<table border="1">';
foreach ($str2 as $str3)
{
echo '<tr>';
for($i=0;$i<5;$i++)
{
echo '
<td>'.$str3.'</td>
';
}
echo '</tr>';
}
echo '</table>';
?>
I have tried many others but not getting required result.
No comments:
Post a Comment