title: Insert data to DB with PHP
body: <p>So I'm creating a simple page and I want that my login and passwords to go to the DB now on the login form:</p>
  
  <pre><code>&lt;form id="form_6de933"  name="validate" action="insert.php" method="post" class="login-form narrow-cols"&gt;
  </code></pre>
  
  <p>I added action="insert.php"
  and on the insert.php file I tried to do this</p>
  
  <pre><code> &lt;?php
  $servername = "localhost";
  $username = "xxx";
  $password = "xxx";
  $dbname = "xxx";
  
  // 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 nametable (username, password)
  ('$_POST[username]','$_POST[password]')";
  
  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>But when I click submit I get this</p>
  
  <p>Parse error: syntax error, unexpected '{' in insert.php on line 10.</p>
  
  <p>So can somone help me fix this error or I'm I doing something wrong?</p>