Fejl i tagwall
<?print "<b>Tidligere beskeder:</b><br><br>";
$res = mysql_query("select * from guestbook order by dato desc limit 10;");
while($gb = mysql_fetch_assoc($res)) {
$gb[besked] = preg_replace("/</","<",$gb[besked]);
$gb[besked] = preg_replace("/>/",">",$gb[besked]);
$gb[besked] = nl2br($gb[besked]);
$dato = date("F j, H:i",$gb[dato]+(3600*5));
print "Navn: $gb[navn]<br>
Dato: $dato<br>
Besked: $gb[besked]";
if ($_GET[action] == "admin") {
print "<br><a href=guestbook.php?action=delete&beskedid=$gb[beskedid]>Slet</a>";
}
print "<br><br><br>";
}
?>
Det er min PHP kode.
Og fejlen er:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in e:\users\new\superegern\html\guestbook.php on line 34
Linje 34 er: while($gb = mysql_fetch_assoc($res)) {
Nogle der kan hjælpe?