PHP gevorderde |
|
Waarom wilt hij niet's weergeven met script:
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><b>Categorien</b> </td>
</tr>
<tr>
<?php
$ophalen = mysql_query("SELECT * FROM `categorie` ");
$controle = mysql_num_rows($ophalen);
if($controle == 0)
{
echo $ERROR_3;
}
else
{
while ($_READ = mysql_fetch_assoc($ophalen))
{
$i++;
echo '
<td>
<table width="200" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td> <a href="?module=categorien&categorie_id=' . $_READ["categorie_id"] . '">' . $_READ["categorie_oms"] . '</a> </td>
</tr>
</table>
</td>';
if($i == 3) {
$i = 0;
echo "</tr><tr>";
}
}
}
?>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td><b>Categorien</b> </td> </tr> <tr> <?php if($controle == 0) { } else { { $i++; <td> <table width="200" border="0" cellspacing="0" cellpadding="0" > <tr> <td> <a href="?module=categorien&categorie_id=' . $_READ["categorie_id"] . '">' . $_READ["categorie_oms"] . '</a> </td> </tr> </table> </td>'; if($i == 3) { $i = 0; } } } ?> </tr> </table>
Mysql:
CREATE TABLE `categorie` (
`ID` int(11) NOT NULL auto_increment,
`categorie_id ` varchar(10) NOT NULL default '',
`categorie_oms ` varchar(20) NOT NULL default '',
PRIMARY KEY (`ID`)
) TYPE=MyISAM AUTO_INCREMENT=6 ;
|