<?php
$i="";
$display_columns = 3;
$sqlm="SELECT * FROM tr_teams ORDER BY id";
$rsm=mysql_query($sqlm) or die("Database Error".mysql_error());
$count = mysql_num_rows($rsm);
$padding = ($display_columns-1)-(($count-1)%$display_columns);
echo '<table width="90%" class="plan">';
while($row=mysql_fetch_array($rsm))
{
if($i%$display_columns == 0)
echo '<tr>';
echo '<td>';
echo $row['team_name'];
echo '</td>';
if($i%$display_columns == $display_columns-1)
echo '</tr>';
$i++;
}
if($padding!=0)
{
for($i=0;$i<$padding;$i++)
echo '<td></td>';
echo '</tr>';
}
echo '</table>';
?>
$i="";
$display_columns = 3;
$sqlm="SELECT * FROM tr_teams ORDER BY id";
$rsm=mysql_query($sqlm) or die("Database Error".mysql_error());
$count = mysql_num_rows($rsm);
$padding = ($display_columns-1)-(($count-1)%$display_columns);
echo '<table width="90%" class="plan">';
while($row=mysql_fetch_array($rsm))
{
if($i%$display_columns == 0)
echo '<tr>';
echo '<td>';
echo $row['team_name'];
echo '</td>';
if($i%$display_columns == $display_columns-1)
echo '</tr>';
$i++;
}
if($padding!=0)
{
for($i=0;$i<$padding;$i++)
echo '<td></td>';
echo '</tr>';
}
echo '</table>';
?>
Nice I like this code and I apply successfully in my project.thnks.........................very much not magar much....
ReplyDelete