PHP beginner |
|
(url: http://members....f&id=2 )
hier zit het probleem:
<?
$cat=$_GET["id"];
$sql="SELECT * FROM stuff WHERE cat='".$cat."' ORDER BY id DESC";
$res=mysql_query($sql);
echo ?>
<table style="border:1px solid #006699" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="26%" height="24" style="border-bottom:1px dashed #006699 "><strong>Naam:</strong></td>
<td width="24%" style="border-bottom:1px dashed #006699 "><strong>Gepost door:</strong></td>
<td width="50%" style="border-bottom:1px dashed #006699 "><strong>Gepost op:</strong></td>
</tr>
<?
while($obj=mysql_fetch_object($res)){
echo ?><tr>
<td width="26%" height="25" style="border-bottom:1px solid #006699 "><a href="<? echo $obj->url; ?>" target="_blank"><? echo $obj->naam; ?></a></td>
<td width="24%" style="border-bottom:1px solid #006699 "><? echo $obj->door; ?></td>
<td width="50%" style="border-bottom:1px solid #006699 "><? echo $obj->datum; ?></td>
</tr>
</table>
<?
}}
?>
<? $cat=$_GET["id"]; $sql="SELECT * FROM stuff WHERE cat='".$cat."' ORDER BY id DESC"; <table style="border:1px solid #006699" width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="26%" height="24" style="border-bottom:1px dashed #006699 "><strong>Naam:</strong></td> <td width="24%" style="border-bottom:1px dashed #006699 "><strong>Gepost door:</strong></td> <td width="50%" style="border-bottom:1px dashed #006699 "><strong>Gepost op:</strong></td> </tr> <? <td width="26%" height="25" style="border-bottom:1px solid #006699 "><a href=" <? echo $obj->url; ?>" target="_blank"> <? echo $obj->naam; ?></a></td> <td width="24%" style="border-bottom:1px solid #006699 "> <? echo $obj->door; ?></td> <td width="50%" style="border-bottom:1px solid #006699 "> <? echo $obj->datum; ?></td> </tr> </table> <? }} ?>
kijk op de site wat het probleem is. als je bij id 1 invult of 3(waar niets in de db staat) is het probleem er niet
|