title: Fatal Error when trying to view PHP data as JSON with XAMPP
body: <p>The following error is present when trying to view api.php using localhost:</p>
  
  <blockquote>
    <p>Fatal error: Assignments can only happen to writable values in
    /opt/lampp/htdocs/MyApi/api.php on line 27</p>
  </blockquote>
  
  <p>I had a few errors in my code that I thought would have been contributing to this error (one of which was on line 27), however, still no joy.  When I comment out line 27, the error moves on to line 28, and so forth. </p>
  
  <p>I have also tried to change the name of my array to 'job' as it was originally the same name as my table, but didn't seem to fix the issue.</p>
  
  <p>Very inexperienced with PHP (this is actually my first major stab at it), so any help would be much appreciated!</p>
  
  <p><strong>PHP</strong></p>
  
  <pre><code>&lt;?php
  
  define ('DB_HOST', 'localhost');
  define ('DB_USER', 'root'); 
  define ('DB_PASS', '');
  define ('DB_NAME', 'homeflow_database');
  
  $conn = new mysqli (DB_HOST, DB_USER, DB_PASS, DB_NAME);
  
  if (mysqli_connect_errno()) {
  
      die('Unable to connect to database '. mysqli_connect_error ());
  }
  
  $stmt = $conn-&gt;prepare ("SELECT maintenance_id, type, property,
  more_info, date FROM maintenance;");
  
  $stmt-&gt;execute();
  
  $stmt-&gt;bind_result($maintenance_id, $type, $property, $more_info, $date);
  
  $job = array();
  
  while($stmt-&gt;fetch()) {
  
  $temp = array ();
  $temp = ['maintenance_id'] = $maintenance_id;
  $temp = ['type'] = $type;
  $temp = ['property'] = $property;
  $temp = ['more_info'] = $more_info;
  $temp = ['date'] = $date;
  
  array_push ($job, $temp);
  
  }
  
  echo json_encode ($job);
  </code></pre>
  
  <p>Thanks</p>