expects parameter 1 to be resource
Jeg får følgende fejl:( ! ) Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in C:\Users\Patr1945\wamp\www\nyt_projekt\index.php on line 32
Call Stack
# Time Memory Function Location
1 0.0006 249728 {main}( ) ..\index.php:0
2 0.0025 258224 mysql_fetch_row ( ) ..\index.php:32
I følgende script:
<html>
<head>
<title>Patricks awesome CMS-system</title>
<style>
</style>
</head>
<?php
include 'connect.php';
if (isset($_GET['sideid'])) {
$sideid = $_GET['sideid'];
} else {
$sideid = '1';
}
echo "<body bgcolor='#990000'>\n";
echo "<table width='100%'><tr>\n";
echo "<td width='20%'>menu</td>\n";
echo "</tr><tr>\n";
echo "<td width='20%'>umenu</td>\n";
echo "</table><table width='100%'>\n";
$sql = mysql_query("SELECT overskrift, indholdet FROM indhold WHERE id = '$sideid'");
while(list($overskrift,$indhold) = mysql_fetch_row($sql)){
echo "<tr><td width='20%'>".$overskrift."</td></tr><tr>\n";
echo "<td width='80%'>".$indholdet."</td></tr>\n";
}
echo "</table></body>\n";
?>
</html>