title: PHP Parse error: syntax error, unexpected T_CLASS
body: <p>I'm new to PHP, and i'm making a forum. all the files work except one file, add_topic.php.</p>
  
  <p>It gives me an error saying:</p>
  
  <blockquote>
    <p>Parse error: syntax error, unexpected T_CLASS in /home/a3885465/public_html/add_topic.php on line 25</p>
  </blockquote>
  
  <p>I know it is probably on the lines:</p>
  
  <pre><code>}
  else{
      echo "ERROR";
  }
  mysql_close();
  </code></pre>
  
  <p>but the whole code is below just in case. </p>
  
  <p>If you have any idea, it would be really appreciated, thanks!</p>
  
  <hr>
  
  <p>The Code for add_topic.php</p>
  
  <pre><code>$host=""host"";
  $username="username";
  $password="password";
  $db_name ="database_name";
  $tbl_name="forum_question";// Table name
  
  // Connect to server and select database.
  mysql_connect("$host", "$username", "$password")or die("cannot connect");
  mysql_select_db("$db_name")or die("cannot select DB");
  
  // get data that sent from form
  $topic=  $_POST['topic'];
  $detail= $_POST['detail'];
  $name=   $_POST['name'];
  $email=  $_POST['email'];
  
  $datetime=date("d/m/y h:i:s");//create date time
  
  $sql="INSERT INTO $tbl_name(topic, detail, name, email, datetime)VALUES('$topic',
      '$detail', '$name', '$email', '$datetime')";
  $result=mysql_query($sql);
  
  if($result){
      echo "Successful&lt;BR&gt;";
      echo "&lt;a href=main_forum.php&gt;View your topic&lt;/a&gt;";
  else{
      echo "ERROR";
  }
  mysql_close();
  ?&gt;
  </code></pre>