Jump to content



Recommended Posts

Hi All


Using the code below I am getting an error of

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/fhlinux171/b/bravo14.co.uk/user/htdocs/gavster/headlines.php on line 41,


however I have copied a page that works and changed the relevant parts which will mean that line 41 is OK, I appreciate that the code could probably be slicker, however still learning php, can anyone spot any errors with the code that would get the error ?


$con = mysql_connect('ip', 'user', 'password', true);
      die('Could not connect: ' . mysql_error());
mysql_select_db('gavstersays', $con);
$result = mysql_query('SELECT * FROM `posts`where `topic_id`=\'' . $_GET['topic_id'] . '\'' , $con) or die(mysql_error());
if(mysql_num_rows($result) < 1) 

   echo('<tr><td colspan="2">Sorry, no results were found.</td></tr>'); 
   while($row = mysql_fetch_array($result))
echo('<tr><td>'.date("d-M-Y", strtotime($row[postdate])).'</td>');
echo('<td><a href="article.php?post_id='.$row[post_id].'">'.$row[title].'</a></td></tr>');

Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.