title: Unexpected Error -
body: <p>I'm very new to PHP, I was just looking at an example to set up a WAMP server and use PHP to connect with the server. I inserted some data into a table in the database and wanted to retrieve all the data using the PHP file. </p>
  
  <p>When I try to check for the output by doing this:</p>
  
  <p>" localhost/android_connect/get_all_products.php "</p>
  
  <p>I'm getting this error:</p>
  
  <p>Parse error: syntax error, unexpected '$response' (T_VARIABLE) in C:\wamp\www\android_connect\get_all_products.php on line 5</p>
  
  <p>This is the example:</p>
  
  <pre><code>    &lt;?php
      // array for JSON response
  
      $response = array();
      $db = new DB_CONNECT(); 
      $result = mysql_query("SELECT *FROM products") or die(mysql_error());
  
      if (mysql_num_rows($result) &gt; 0) {
          $response["products"] = array();
          while ($row = mysql_fetch_array($result)) {
  
              $product = array();
              $product["id"] = $row["id"];
              $product["name"] = $row["name"];
              $product["price"] = $row["price"];
              $product["description"] = $row["description"];
              $product["created_at"] = $row["created_at"];
              $product["updated_at"] = $row["updated_at"]; 
              array_push($response["products"], $product);
  
          }
          
          $response["success"] = 1;
          echo json_encode($response);
       } else {
  
          $response["success"] = 0;
          $response["message"] = "No products found";
          echo json_encode($response);
  
      }
      ?&gt;
  </code></pre>
  
  <p>I understand that its syntax error, but I cannot find where exactly.</p>