Nieuw lid |
|
Ik heb een linksysteem gemaakt, maar het bevat nog een foutje.
Dit is de fout
Citaat: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/voetbal/public_html/f1wereld/links.php on line 43
Dit is lijn 43
while($record = mysql_fetch_assoc($resultaat))
Dit is de code van de hele pagina
<link rel="stylesheet" type="text/css" href="style.css"/>
<table width="480" border="0" align="center" cellpadding="0" cellspacing="0" style="border: #000 1px solid">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="20" background="site_images/titelbalkvooroamenu.jpg"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center"><strong>Links</strong></div></td>
</tr>
</table></td>
</tr>
<tr>
<td background="site_images/tabel_achtergrond.jpg"><table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="justify">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr background="/site_images/geleschaduw.jpg">
<td><strong>Coureurs</strong></td>
<td><strong>Teams</strong></td>
<td><strong>Circuits</strong></td>
</tr>
<tr>
<td width="33%">
<?PHP ERROR_REPORTING(E_ALL);
$dbh=mysql_connect ("localhost", "voetbal_f1w", "w8woord") or die ("I cannot connect to the database because: ".mysql_error());
mysql_select_db ("voetbal_f1w");
$sql = "SELECT * FROM links WHERE beschrijving = Coureurs ORDER BY naam";
$resultaat = mysql_query($sql, $dbh);
while($record = mysql_fetch_assoc($resultaat))
{
echo "<a href=".$record["url"].">".$record["naam"]."</a><br />";
}
?>
</td>
<td width="33%">
<?PHP ERROR_REPORTING(E_ALL);
$dbh=mysql_connect ("localhost", "voetbal_f1w", "w8woord") or die ("I cannot connect to the database because: ".mysql_error());
mysql_select_db ("voetbal_f1w");
$sql = "SELECT * FROM links WHERE beschrijving = Teams ORDER BY naam";
$resultaat = mysql_query($sql, $dbh);
while($record = mysql_fetch_assoc($resultaat))
{
echo "<a href=".$record["url"].">".$record["naam"]."</a><br />";
}
?>
</td>
<td width="34%"> </td>
</tr>
</table>
</div></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<link rel="stylesheet" type="text/css" href="style.css"/> <table width="480" border="0" align="center" cellpadding="0" cellspacing="0" style="border: #000 1px solid"> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="20" background="site_images/titelbalkvooroamenu.jpg"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><div align="center"><strong>Links</strong></div></td> </tr> </table></td> </tr> <tr> <td background="site_images/tabel_achtergrond.jpg"><table width="96%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><div align="justify"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr background="/site_images/geleschaduw.jpg"> <td><strong>Coureurs</strong></td> <td><strong>Teams</strong></td> <td><strong>Circuits</strong></td> </tr> <tr> <td width="33%"> $sql = "SELECT * FROM links WHERE beschrijving = Coureurs ORDER BY naam"; { echo "<a href=".$record["url"].">".$record["naam"]."</a><br />"; } ?> </td> <td width="33%"> $sql = "SELECT * FROM links WHERE beschrijving = Teams ORDER BY naam"; { echo "<a href=".$record["url"].">".$record["naam"]."</a><br />"; } ?> </td> <td width="34%"> </td> </tr> </table> </div></td> </tr> </table></td> </tr> </table></td> </tr> </table>
Wat heb ik verkeerd gedaan.
|