title: How to use Var Dump to update SQL record using $_POST
body: <p>I want to send input data from a form on publish.php to updateCopy.php that will then update the "postCopy" column on my SQL database.</p>
  
  <p>Here's my code so far:</p>
  
  <p><strong>publish.php</strong></p>
  
  <pre><code>&lt;form action="\.\.\updateCopy.php" method="post" id="newCopy"&gt;
  &lt;input type="text" name="postCopy"&gt;
  &lt;input type="submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>updateCopy.php</strong></p>
  
  <pre><code>&lt;?php
  $servername = "localhost";
  $username = "root";
  $password = "";
  $dbname = "main";
  
  // Create connection
  $conn = new mysqli($servername, $username, $password, $dbname);
  // Check connection
  if ($conn-&gt;connect_error) {
      die("Connection failed: " . $conn-&gt;connect_error);
  } 
  
  $sql = "UPDATE posts SET postCopy= var_dump ($_POST["postCopy"]); WHERE id=123456789";
  
  if ($conn-&gt;query($sql) === TRUE) {
      echo "Record updated successfully";
  } else {
      echo "Error updating record: " . $conn-&gt;error;
  }
  
  $conn-&gt;close();
  ?&gt;
  </code></pre>
  
  <p>When I attempt to run this process I get the following error:</p>
  
  <blockquote>
    <p>Parse error: syntax error, unexpected '"', expecting '-' or identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING)</p>
  </blockquote>
  
  <p>Is anyone able to tell me how I can effectivley use var_dump ($_POST["postCopy"]); to include the updated postCopy info and then update my SQL db?</p>