hiya im working on my test development http://test.jennifersplaygroup.co.uk now if you go to my stories page then click on any story and then on a comment it comes up a error
I been looking though the code but can't seem to be able to find the error
Code:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/fhlinux169/t/test.jennifersplaygroup.co.uk/user/htdocs/includes/story_comments.php on line 23
I been looking though the code but can't seem to be able to find the error
Code:
<?php
$host = "mysql10.streamline.net";
$username = "usr";
$password = "pass";
$database = "database";
$server = mysql_connect($host, $username, $password);
$connection = mysql_select_db($database, $server);
$server = mysql_connect($host, $username, $password);
$db = mysql_select_db($database, $server);
$id = $_GET['id'];
$sql = mysql_query("SELECT * FROM `storys_comments` WHERE story_id = $id ORDER BY id DESC");
?>
<div id="globalNav">
<div>
<h2>Comments</h2>
</div>
</div>
<div id="headlines">
</div>
<div id="content">
<div>
<?php
while ($row = mysql_fetch_array($sql, MYSQL_BOTH)) {
print nl2br($row[3]);
print "<br />By $row[2]<br /><hr><br />";
}
?>
</div>
</div>
<!-- end content -->
<div id="navBar">