Jump to content

[SOLVED] Can't figure out why I am getting an error


DangerM0use

Recommended Posts

I can't figure out why I am getting the following error;

 

Parse error: syntax error, unexpected $end in /misc/27/000/107/398/6/user/web/xb-online.net/testing/article1.php on line 50

 

for the following code.

 

<html>
<head>
<title>Website article test version</title>
</head>
<body>
<?php 
if(empty($_GET['id'])) 
{ 
   echo "<p class='error'>No article ID supplied.</p>\n"; 
} 
else if(!$_POST['id'])
{ 

   //include config file 
   include "config.php"; 
   
  
  $title = ($_POST['title']);
   $query = "SELECT title, author, text FROM news WHERE id=".$_GET['id']; 
   $result = mysql_query($query) or die("Query failed: ".mysql_error()); 
   
   if (mysql_num_rows($result) > 0) { 
    // yes 
    // print them one after another
     
    echo "<table cellpadding=10 border=1>";
    while($row = mysql_fetch_assoc($result)) { // I like fetch_assoc better
        echo "<tr>";
        echo "<td>".$row['title']."</a></td>";
        echo "<td>".$row['author']."</td>";
        echo "<td>".$row['text']."</td>";
        echo "</tr>";
    }
    echo "</table>";
} 
else { 
    // no 
    // print status message 
    echo "No rows found!"; 
}
// free result set memory 
mysql_free_result($result); 

// close connection 
mysql_close($connection); 

?> 
<a href ="index.php">Home</a>
</body>
</html>

 

As far as I can tell I have closed all the PHP lines so I can't figure out why it won't allow me to close the html

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

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

Guest
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.