2 kolommen
de code van de pagina die ik gebruik:
Code (php)
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
<?php
mysql_select_db($database_main, $main);
$query_link = "SELECT * FROM afflinks WHERE linkcat = 'models' ORDER BY rand()";
$link = mysql_query($query_link, $main) or die(mysql_error());
$row_link = mysql_fetch_assoc($link);
$totalRows_link = mysql_num_rows($link);
?>
mysql_select_db($database_main, $main);
$query_link = "SELECT * FROM afflinks WHERE linkcat = 'models' ORDER BY rand()";
$link = mysql_query($query_link, $main) or die(mysql_error());
$row_link = mysql_fetch_assoc($link);
$totalRows_link = mysql_num_rows($link);
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table border="1">
<tr>
<td>linktitel</td>
</tr>
<tr>
<td><a href=""></a></td><br>
<td><a href=""></a></td>
</tr>
</table>
</body>
</html>
In je lus een if neerzetten:
<tr>
<td><a href=""></a></td><br>
<td><a href=""></a></td>
</tr>
hee Jelmer..bedankt...werkt prima!
Gebruik liever de gewone while;
Code (php)
1
2
3
4
5
6
2
3
4
5
6
<?php
while( $row_link = mysql_fetch_assoc($row_link) )
{
// Doe iets met $row_link
}
?>
while( $row_link = mysql_fetch_assoc($row_link) )
{
// Doe iets met $row_link
}
?>