title: Parse error: syntax error, unexpected end of file, expecting function (T_FUNCTION) or const (T_CONST) in C:\xampp\htdocs\vgdb\csearch.php on line 67
body: <p>I have a search bar on my site. When I click on the search button I am getting the error above. I am not an advanced coder so I do not know how to fix it. I have searched online, there are solutions for this problem but they are not working for me. This is for a project that is due in a few days so I would appreciate any help I can get. It's also my first post on here so go easy on me please. Thank You</p>
  
  <p>csearch.php</p>
  
  <pre><code>&lt;?php
  /**
  *Performs a search
  *
  * This class is used to perform search function in a MySQL database
  *
  */
  class search {
    /**
    * MySQLi connection
    *@access private
    *@var object
    */
    private $mysqli;
  
    /**
    * Constructor
    *
    * This sets up the class
    */
  
    public function __construct(){
      // Connect to the database and store in $mysqli property_exists
      $this-&gt;connect();
     }
    /**
    * Database connection
    *
    * This connects to the database
    */
    private function connect() {
      $this-&gt;mysqli = new mysqli( 'localhost', 'root', '', 'games');
      }
  
    /**
    * Search routine
    *
    * Performs a search
    *
    * @param string $search_term The search term
    *
    *
    */
    public function search($search_term) {
      // Sanatize the search term to prevent injection attacks
      $sanitized = $this-&gt;mysqli-&gt;real_escape_string($search_term);
  
      // Run the query
      $query = $this-&gt;mysqli-&gt;query("
      SELECT title
      FROM games
      WHERE title LIKE '%($sanitized)%'
      OR body LIKE '%($sanitized)%'
      ");
  
    // Check results
    if ( ! $query-&gt;num_rows ) {
      return false;
      }
  
  // Loop and fetch objects
  while( $row = $query-&gt;fetch_object() ) {
    $rows[] = $row;
   }
  return $search_results;
  }
  ?&gt;
  </code></pre>
  
  <p>search.php</p>
  
  <pre><code>&lt;?php
  
  $search_results= "";
  
  //check if search data was submitted
  if ( isset( $_GET['s'] ) ) {
  
    // Include the search class
    require_once( dirname( __FILE__ ) . '/csearch.php' );
  
    // Instantiate a new instance of the search class
    $search = new search();
  
    // Store search term into a variable
    $search_term = $_GET['s'];
  
    // Send the search term to the search class and store the result
    $search_results = $search-&gt;search($search_term);
  
  }
  ?&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;meta hhtp-equiv="X-UA-Compatible" content="IE-edge"&gt;
    &lt;title&gt;VGDB | SEARCH&lt;/title&gt;
    &lt;meta name="description" content=""&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
    &lt;link rel="stylesheet" href="../vgdb/css/main.css"&gt;
    &lt;link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-
  awesome.min.css" rel="stylesheet" integrity="sha384-
  wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" 
  crossorigin="anonymous"&gt;
    &lt;link href='https://fonts.googleapis.com/css?family=Hind:600,400' 
  rel='stylesheet'&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;?php include 'header.php';?&gt;
  
  &lt;div class="container"&gt;
    &lt;div class="col-md-5 col-md-offset-1"&gt;
      &lt;div class="row"&gt;
        &lt;div class="col-md-6"&gt;
      &lt;div class="search"&gt;
        &lt;h1&gt;50,000 games and counting...&lt;/h1&gt;
        &lt;form action="" method="get"&gt;
          &lt;input type="search" name="s" placeholder="Search for games..." 
  results="5" value="&lt;?php echo $search_term; ?&gt;"&gt;
          &lt;input type="submit" value="Search"&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;/form&gt;
  &lt;?php if ( $search_results ) : ?&gt;
    &lt;div class="results-count"&gt;
      &lt;p&gt;&lt;?php echo $search_results['count']; ?&gt; results found&lt;/p&gt;
    &lt;/div&gt;
    &lt;div class="results-table"&gt;
      &lt;?php foreach ( $search_results['results'] as $search_result) : ?&gt;
        &lt;div class="result"&gt;
          &lt;p&gt;&lt;?php echo $search_result-&gt;title; ?&gt;&lt;/p&gt;
        &lt;/div&gt;
      &lt;?php endforeach; ?&gt;
    &lt;/div&gt;
  &lt;?php endif; ?&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  &lt;?php include 'footer.php';?&gt;
  </code></pre>