title: mysql and php form and connection
body: <p>this seems to be correct but I'm missing it somehow.</p>
  
  <p>form in a demo-form.php file</p>
  
  <pre><code>&lt;form action="test.php" method="post" /&gt;   
  &lt;p&gt;Name: &lt;input type="text" name="name" /&gt;&lt;/p&gt;
  &lt;p&gt;Email: &lt;input type="text" name="email" /&gt;&lt;/p&gt;
  &lt;input type="submit" value="Submit" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>code in a test.php file</p>
  
  <pre><code>&lt;?php
  $servername = "localhost";
  $username = "root";
  $password = "";
  $dbname = "forms1";
  
  // Create connection
  $conn = new mysqli($servername, $username, $password, $dbname);
  // Check connection
  if ($conn-&gt;connect_error) {
  die("Connection failed: " . $conn-&gt;connect_error);
  }
  
  $sql = "INSERT INTO per_Info (name, email)
  VALUES ('Test', 'test@example.com')";
  
  if ($conn-&gt;query($sql) === TRUE) {
  echo "New record created successfully";
  } else {
  echo "Error: " . $sql . "&lt;br&gt;" . $conn-&gt;error;
  }
  
  $conn-&gt;close();
  ?&gt;
  </code></pre>
  
  <p>The problem: it inserts 'Test', 'test@example.com' into the database (under "name" and "email") instead of whatever name I actually type into the form, in other words, if I type "John" and "John@test.com in the Name field on the form it will only insert 'Test', 'test@example.com' and not "John", etc.</p>