title: PHP code won't update Database
body: <p>I am working my assignment and i can't get my update to work with my database.
  Here is my form that holds the data.</p>
  
  <pre><code>&lt;form name="edit" method="post" action="process/editRecord.php"&gt;
  
      &lt;p class="indent"&gt;
        &lt;label for="projectName"&gt;Edit Project Name&lt;/label&gt;
        &lt;input type="text" name="projectName" id="projectName" value="&lt;?php echo $projectName; ?&gt;"&gt;
      &lt;/p&gt;
  
      &lt;p class="indent"&gt;
        &lt;label for="projectSoftware"&gt;Edit Project Software&lt;/label&gt;
        &lt;input type="text" name="projectSoftware" id="projectSoftware" value="&lt;?php echo $projectSoftware; ?&gt;" &gt;
      &lt;/p&gt;
  
  
      &lt;p class="indent"&gt;
        &lt;label for="projectDescription"&gt;Edit Project Description&lt;/label&gt;
        &lt;textarea name="projectDescription" id="projectDescription" cols="150" rows="10" &gt;&lt;?php echo $projectDescription; ?&gt;&lt;/textarea&gt;
      &lt;/p&gt;
  
      &lt;p class="indent"&gt;
        &lt;label for="projectImage"&gt;Edit Project Image&lt;/label&gt;
        &lt;input type="text" name="projectImage" id="projectImage" value="&lt;?php echo $projectImage; ?&gt;" &gt;
      &lt;/p&gt;
  
      &lt;p class="indent"&gt;
        &lt;label for="projectInformation"&gt;Edit Project Information&lt;/label&gt;
        &lt;textarea name="projectInformation" id="projectInformation" cols="400" rows="10" &gt;&lt;?php echo $projectInformation; ?&gt;&lt;/textarea&gt;
      &lt;/p&gt;
  
      &lt;p&gt;
        &lt;input type="submit" name="button" id="button" value="Update"&gt;
      &lt;/p&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>And then is the process.</p>
  
  <pre><code>&lt;?php
  ini_set('display_errors', 1);
  require('../../includes/conn.inc.php');
  require('../../includes/functions.inc.php');
  // sanitize user variables
  $sprojectName = safeString($_POST['projectName']);
  $sprojectSoftware = safeString($_POST['projectSoftware']);
  $sprojectDescription = safeString($_POST['projectDescription']);
  $sprojectImage = safeString($_POST['projectImage']);
  $sprojectInformation = safeString($_POST['projectInformation']);
  $sprojectID = safeInt($_POST['projectID']);
  // prepare SQL
  $stmt = $mysqli-&gt;prepare("UPDATE projects SET projectName =?, projectSoftware =?, projectDescription=?, projectImage =?, projectInformation =? WHERE projectID = ?");
  $stmt-&gt;bind_param('sssssi', $sprojectName, $sprojectSoftware, $sprojectDescription, $sprojectImage, $sprojectInformation, $sprojectID);
  $stmt-&gt;execute();
  $stmt-&gt;close();
  
  header("Location: ../../php/projects.php");
  // redirect browser
  exit; // make sure no other code executed
  ?&gt;
  </code></pre>
  
  <p>I get no errors when using this and it doesn't update my database but goes back to relevant projects page.</p>