Hello Again Great Ones,
I am trying to get my sql results to display with a limit of 4 columns per row...
I have looked around the forum and found the following .. just need a little help applying it... I appreciate your help ahead of time - mrphish0812
I've tried a number of different approaches but this is what I have - I think I need the $colimit var. in somewhere, but where?
<table>
<?php
$sqlquery = "SELECT * from infoweb_category";
$queryresult = mysql_query($sqlquery);
while ($row=mysql_fetch_array($queryresult))
{
$colimit = 4;
$sqlquery2 = "SELECT name,categoryid from infoweb_category where categoryid='".$row["categoryid"]."'";
$count=0;
$queryresult2 = mysql_query($sqlquery2);
if ($row2=mysql_fetch_array($queryresult2))
{
$tr .= "<tr><td valign=top align=center>
<font size=1 face=verdana>".$row["name"]."<br><br>
<a href=\"show_main.php?category=".$row["categoryid"]."\"><img src=".$row["image"]." hspace=15 title=\"".$row["name"]."\" border=0></a>
</td></tr>";
if ($count%$colimit == 0) {
if ($count != 0) {
$tr .= "<tr></tr>\n";
}
}
</table>
}
}
?>
Thnkx Again ...
Robb D