Onbekend |
|
Et klopt niet:|
1.je doet quotes om getallen
2.je gebruikt fetchobject
3.je gebruikt vars die niet bestaan, $qgg dus
Dit moet het doen:
<?
require("config.php");
?>
<div align='left'>
<table border=0 width=233 height=114 cellspacing=0 cellpadding=0 style='border: 1 solid #C0C0C0' bgcolor='#F8F8F8'>
<tr>
<td width=233 height=114 valign='top'>
<div align='left'>
<table border=0 width=261 height=1 cellspacing=0 cellpadding=0>
<tr>
<td width=67 height=1><b><font size=1 face='Verdana'>Naam:</font></b></td>
<td width=90 height=1><b><font size=1 face='Verdana'>Aantal Hits:</font></b></td>
<td width=76 height=1></td>
</tr>
<?
$query = mysql_query("SELECT naam, hits, url FROM links") or die(mysql_error());
$result = mysql_num_rows($query) or die(mysql_error());
if(!$result){
echo "We hebben nog geen links...";
}
else{
while($link = mysql_fetch_row($query)){
echo "<tr>
<td width=67 height=1 valign='top'><font size=1 face='Verdana'>'".$link[0]."'</font></td>
<td width=90 height=1 valign='top'><font size=1 face='Verdana'>'".$link[1]."'</font></td>
<td width=76 height=1 valign='top'><font size=1 face='Verdana'><a href='door.php?naam=".$link[0]."&url=".$link[2]."' onclick=\"NewWindow(this.href,'name',204,200,'yes');return false\"><img border=0 src='../images/open.jpg' width=88 height=29></a></font></td>
</tr>
";
}
}
?>
</table>
</div>
<? require("config.php"); ?> <div align='left'> <table border=0 width=233 height=114 cellspacing=0 cellpadding=0 style='border: 1 solid #C0C0C0' bgcolor='#F8F8F8'> <tr> <td width=233 height=114 valign='top'> <div align='left'> <table border=0 width=261 height=1 cellspacing=0 cellpadding=0> <tr> <td width=67 height=1><b><font size=1 face='Verdana'>Naam:</font></b></td> <td width=90 height=1><b><font size=1 face='Verdana'>Aantal Hits:</font></b></td> <td width=76 height=1></td> </tr> <? if(!$result){ echo "We hebben nog geen links..."; } else{ <td width=67 height=1 valign='top'><font size=1 face='Verdana'>'".$link[0]."'</font></td> <td width=90 height=1 valign='top'><font size=1 face='Verdana'>'".$link[1]."'</font></td> <td width=76 height=1 valign='top'><font size=1 face='Verdana'><a href='door.php?naam=".$link[0]."&url=".$link[2]."' onclick=\"NewWindow(this.href,'name',204,200,'yes');return false\"><img border=0 src='../images/open.jpg' width=88 height=29></a></font></td> </tr> "; } } ?> </table> </div>
Zo gaat hij het doen, en ook nog een stuk sneller. Anders ligt het aan je DB:o |