[text]ID: 1, Name: Intro, Desc: The Homepage, Text: Welcome[/text]
However in the code:
Code: Select all
<?php
include("database.php");
ob_start();
$pages = mysql_fetch_object(mysql_query("select count(ID) as count from swarm_wiki")) -> count;
echo <<<END
<head>
<title>Crimson Swarm</title>
</head>
END;
echo <<<end
<div style = "overflow:scroll;height:100%;width:200px;">
end;
$p = 0;
for ($i = 1; $i <= $pages; $i++) {
$p = $p+1;
${note.$p."title"} = mysql_fetch_object(mysql_query("select Name from swarm_wiki where ID = '$p'")) ->Name;
${note.$p."desc"} = mysql_fetch_object(mysql_query("select Desc from swarm_wiki where ID = '$p'")) ->Desc;
${note.$p."text"} = mysql_fetch_object(mysql_query("select Text from swarm_wiki where ID = '$p'")) ->Text;
$title = ${note.$p."title"};
$desc = ${note.$p."desc"};
$text = ${note.$p."text"};
$pos = 50*($p-1);
$submit = "Submit".$p;
echo <<<END
<div style = "height:50px;width:100%;position:inherit;left:0px;top:$pos;background-color:#3399FF;">
<INPUT style = "position:inherit;height:50%;width:100%;background-color:#3399FF;top:0px;left:0px;" value = "$title" name = "$submit">
<div style = "position:inherit;height:50%;left:0px;top:50%;width:100%;">
<p>$desc</p>
</div>
</div>
END;
}
echo "</div>";
$p = 0;
for ($i = 1; $i <= $pages; $i++) {
$p = $p+1;
$submit = "Submit".$p;
if (isset($_POST[$submit])) {
setcookie("page",$p,time()+60*60);
echo <<<end
<head>
<meta HTTP-EQUIV="REFRESH" content="0; url='index.php'">
</head>
end;
}
}
echo "<div style = 'height:100%;left:200px;right:0px;'>";
echo "<h1 style='text-align:center;'>Crimson Wiki</h1>";
echo <<<END
<div style="overflow:scroll;top:150px;left:0px;bottom:0px;position:inherit;">
END;
if (!$_COOKIE['page']) {
$text = $note1text;
$title = $note1title;
$desc = $note1desc;
echo <<<END
<div style="height:150px;width:100%;position:inherit;top:0px;left:0px;">
<h2>$title</h2>
</div>
<div style="height:100px;width:100%;position:inherit;top:150px;left:0px;">
<i>$desc</i>
</div>
<div style="top:150px;left:0px;width:100%;position:inherit;">
<p>$text</p>
</div>
END;
} else {
$p = $_COOKIE['page'];
$text = ${note.$p."text"};
$title = ${note.$p."title"};
$desc = ${note.$p."desc"};
echo <<<END
<div style="height:150px;width:100%;position:inherit;top:0px;left:0px;">
<h2>$title</h2>
</div>
<div style="height:100px;width:100%;position:inherit;top:150px;left:0px;">
<i>$desc</i>
</div>
<div style="top:150px;left:0px;width:100%;position:inherit;">
<p>$text</p>
</div>
END;
}
echo "</div>";
?>[text]Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/bentatma/public_html/swarm/index.php on line 4[/text]
Which normally means there is nothing going to the fetch object on this:
Code: Select all
$pages = mysql_fetch_object(mysql_query("select count(ID) as count from swarm_wiki")) -> count;