bravo14 Posted July 25, 2008 Share Posted July 25, 2008 Hello all I have the following error on a page Parse error: syntax error, unexpected $end in /home/fhlinux171/b/bravo14.co.uk/user/htdocs/gavster/article.php on line 107 <?php $con = mysql_connect('213.171.219.92', 'gav', 'gavin', true); if(!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db('gavstersays', $con); $result = mysql_query('SELECT * FROM `comments` where `post_id`=\'' . $_GET['post_id'] . '\'' , $con) or die(mysql_error()); if(mysql_num_rows($result) < 1) { echo('<tr><td>Sorry, no results were found.</td></tr>'); } else { while($row = mysql_fetch_array($result)) { echo ('<div class="comment">'); echo('<p>'.$row[name].' | '.$row[commentdate].'</p>'); echo('<p>'.$row[comment].'</p>'); echo('</div>'); mysql_close($con); ?> Line 107 is </html> I can't spit anything wrong with the code, but have probably gone code blind. Any ideas Quote Link to comment Share on other sites More sharing options...
ratcateme Posted July 25, 2008 Share Posted July 25, 2008 add two }'s after the mysql_close $end normal means there are unclosed {'s in your script Scott. Quote Link to comment Share on other sites More sharing options...
DarkWater Posted July 25, 2008 Share Posted July 25, 2008 A $end error typically means that you forgot a closing brace in your script. Quote Link to comment Share on other sites More sharing options...
bravo14 Posted July 25, 2008 Author Share Posted July 25, 2008 Cheers Guys You never fail to assist Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.