<?php
for ($i=1; $i<=$row3['value']; $i++) //loop for every column
{
$query4 = "SELECT
*
FROM
user_menu_items
WHERE
column = ".$i;
$result4 = mysql_query($query4) or die (mysql_error());
$width = floor(100/$row3['value']);
echo('<div class="usermenucolumn" width="'.$width.'%">');
if (mysql_num_rows($result4))
{
while ($row4 = mysql_fetch_array($result4)) //loop for every menu item
{
echo('<a href="'.$row4['link'].'">'.$row4['name'].'</a>');
}
}
echo('</div>');
}
?>
<?php
for($i=1;$i<=$row3['value'];$i++)//loop for every column
<?php
for ($i=1; $i<=$row3['value']; $i++){ //loop for every column
$query = mysql_query("SELECT * FROM user_menu_items WHERE column = '".$i."' ") or die (mysql_error());
$width = floor(100/$row3['value']);
echo "<div class='usermenucolumn' width='".$width."%'>";
if (mysql_num_rows($result4))
{
while ($row4 = mysql_fetch_array($query)) //loop for every menu item
{
echo "<a href=".$row4['link'].">".$row4['name']."</a>";
}
}
echo "</div>";
}
?>
<?php
for($i=1;$i<=$row3['value'];$i++){//loop for every column