I wrote PHP script to upload an image inside of a table row. It works but now Web Page won't load to display the table
<p>I'm trying to write a PHP script to upload an image to my server, and have the image show in a Database table row. I created an file upload script and I notice that the image file is being uploaded successfully to the server, and I can also see the file name of the image in phpMyAdmin. The problem I'm having is that now my page won't load in the browser to display the database table. It keeps saying "The web page isn’t working and that the webpage is currently unable to handle this request 500." When I remove the if statement I created for the file upload the webpage shows the database table, but it doesn't show the file image because it's deleted. When I leave the if statement in the script the file upload works fine, but then again I keep getting the webpage load error. This is the script.</p>

<pre><code>  echo '&lt;table id="output" border="1"&gt;
     &lt;tr&gt;
     &lt;th&gt;ID&lt;/th&gt;
     &lt;th&gt;Sq. Ft.&lt;/th&gt;
     &lt;th&gt;Price&lt;/th&gt; 
     &lt;th&gt;Street Address&lt;/th&gt;
     &lt;th&gt;Bedrooms&lt;/th&gt;
     &lt;th&gt;Baths&lt;/th&gt;
     &lt;th&gt;Finished Basement&lt;/th&gt;
     &lt;th&gt;Fence&lt;/th&gt;
     &lt;th&gt;Pool&lt;/th&gt;
     &lt;th&gt;Year Built&lt;/th&gt;
     &lt;th&gt;Featured&lt;/th&gt;
     &lt;th&gt;Homes&lt;/th&gt;
   &lt;/tr&gt;';

  $increment = 0; //declare and initialize a count variable to keep track of the rows we selected

while ( $row = mysqli_fetch_array($result) ) { //build form from selected homes

echo '&lt;tr&gt;
       &lt;td&gt;&lt;center&gt;' . $row['id'] . '&lt;/center&gt;&lt;/td&gt;   
       &lt;td&gt;&amp;nbsp;&amp;nbsp;' . $row['sf'] . '&lt;/td&gt;
       &lt;td&gt;&amp;nbsp;&amp;nbsp;' . $row['price'] . '&lt;/td&gt;
       &lt;td&gt;&amp;nbsp;&amp;nbsp;' . $row['street_address'] . '&lt;/td&gt;
       &lt;td&gt;&amp;nbsp;&amp;nbsp;' . $row['bedrooms'] . '&lt;/td&gt;
       &lt;td&gt;&amp;nbsp;&amp;nbsp;' . $row['baths'] . '&lt;/td&gt;
       &lt;td&gt;&amp;nbsp;&amp;nbsp;' . ($row['finished_basement']?'Yes':'No') . '&lt;/td&gt;
       &lt;td&gt;&amp;nbsp;&amp;nbsp;' . ($row['fence']?'Yes':'No') . '&lt;/td&gt;
       &lt;td&gt;&amp;nbsp;&amp;nbsp;' . ($row['pool']?'Yes':'No') . '&lt;/td&gt;
       &lt;td&gt;&amp;nbsp;&amp;nbsp;' . $row['year_built'] . '&lt;/td&gt;
       &lt;td&gt;&amp;nbsp;&amp;nbsp;' . $row['featured'] . '&lt;/td&gt;
       &lt;td&gt;'if (is_file(GW_UPLOADPATH . $row['homes']) &amp;&amp; filesize(GW_UPLOADPATH . $row['homes']) &gt; 0) {
  echo &lt;td&gt;'&lt;img src="' . GW_UPLOADPATH . $row['homes'] . '" alt="Picture of Home" /&gt;'&lt;/td&gt;;
  }
  else {
  echo &lt;td&gt;'&lt;img src="' . GW_UPLOADPATH . 'missingimg.jpg' . '" alt="No Image" /&gt;'&lt;/td&gt;;
  }
  '&lt;/tr&gt;';

 $increment = $increment + 1; // add one to the counter for each row put into the table  

 }

echo '&lt;p id="row_info"&gt;CHECK OUT OUR ' . $increment . ' FEATURED LISTINGS!!!&lt;/p&gt;&lt;br /&gt;';  

echo '&lt;/table&gt;';
</code></pre>