Цитата |
while ($row = mysql_fetch_assoc($query)) echo '<li><a href="'.$row['title'].'">'.$row['name'].'</a></li>'; |
SELECT * FROM brend ORDER BY id
<?php
$query = mysql_query("SELECT * FROM brend ORDER BY id");
if(!mysql_num_rows($query)) {
echo 'Ничего нет';
}
else {
$i=1;
echo '<table><tr>';
while ($row = mysql_fetch_assoc($query))
echo '<td><a href="'.$row['title'].'">'.$row['name'].'</a></td>';
$i++;
if ($i==11) {echo '</tr><tr>'; $i=1;
}
echo '</tr></table>';
?>
<?php
$query = mysql_query("SELECT * FROM brend ORDER BY id");
if(!mysql_num_rows($query)) {
echo 'Ничего нет';
}
else {
$i=1;
echo '<div id="blabla"><ul>';
while ($row = mysql_fetch_assoc($query))
echo '<li><a href="'.$row['title'].'">'.$row['name'].'</a></li>';
$i++;
if ($i==11) {echo '</ul></div><div id="blabla"><ul>'; $i=1;
}
echo '</ul></div>';
?>
#blabla {
float: left; }