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 Link to comment https://forums.phpfreaks.com/topic/116654-solved-end-error/ 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. Link to comment https://forums.phpfreaks.com/topic/116654-solved-end-error/#findComment-599793 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. Link to comment https://forums.phpfreaks.com/topic/116654-solved-end-error/#findComment-599809 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 Link to comment https://forums.phpfreaks.com/topic/116654-solved-end-error/#findComment-599820 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.