title: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 5
body: <p>I can't get the data from my form to load into MySQL Database. Please help!
  This is the error that i get:</p>
  
  <blockquote>
    <p>Error: INSERT INTO add_review (name,email,details) VALUES ( 'Darron
    Brown', 'blank@gmail.com', 'ldldjd', ) You have an error in your SQL
    syntax; check the manual that corresponds to your MySQL server version
    for the right syntax to use near ')' at line 5</p>
  </blockquote>
  
  <pre><code>&lt;?php
  // Connect to MySQL
    // a. Variables
    $host = "hostname";
    $username = "user";
    $password = "secretpassword";
    $dbname = "myDatabase";
  
    // b. Connection
    $connection = mysqli_connect($host, $username, $password, $dbname);
  
    // c. Check our connection
    if(mysqli_connect_errno()) {
      die("Database connection failed: " .
        mysqli_connect_error() .
        " (" . mysqli_connect_errno() . ")"
      );
    }
    // Insert our data
    $name = isset($_POST["name"]) ? $_POST["name"] : "";
    $email = isset($_POST["email"]) ? $_POST["email"] : "";
    $details = isset($_POST["details"]) ? $_POST["details"] : "";
  
    $name = mysqli_real_escape_string($connection, $name);
    $email = mysqli_real_escape_string($connection, $email);
    $details = mysqli_real_escape_string($connection, $details);
  
    $sql = "INSERT INTO add_review (name,email,details) VALUES (
            '$name',
            '$email',
            '$details',
          )";
  // $insert = $connection-&gt;query($sql);
  
    // Print response from MySQL
    if (mysqli_query($connection, $sql)) {
      echo "New record created successfully";
  } else {
      echo "Error: " . $sql . "&lt;br&gt;" . mysqli_error($connection);
  }
  
    // Close our connection
    mysqli_close($connection);
  ?&gt;
  </code></pre>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class = "section page"&gt;
    &lt;div class="wrapper"&gt;
  
      &lt;h1&gt;Add a Review&lt;/h1&gt;
      &lt;p&gt;If you think there is something I am missing, let me know! Complete the form to send me an email.&lt;/p&gt;
      &lt;form method="post" action=""&gt;
        &lt;table&gt;
          &lt;tr&gt;
            &lt;th&gt;&lt;label for="name"&gt;Movie Name&lt;/label&gt;&lt;/th&gt;
            &lt;td&gt;&lt;input type="text" id="name" name="name" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;th&gt;&lt;label for="email"&gt;Email&lt;/label&gt;&lt;/th&gt;
            &lt;td&gt;&lt;input type="text" id="email" name="email" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;th&gt;&lt;label for="email"&gt;Suggest Movie Details&lt;/label&gt;&lt;/th&gt;
            &lt;td&gt;&lt;textarea name="details" id="details"&gt;&lt;/textarea&gt;&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/table&gt;
        &lt;input type="submit" value="Send" /&gt;
      &lt;/form&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>