title: Error: You have an error in your SQL syntax at line 1 INSERT INTO
body: <p>I'm trying to insert a row into a table. Well, the page add the row, but when it does, appears a MySQL error, something like this:</p>
  
  <blockquote>
    <p>Error: 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 '1' at line 1</p>
  </blockquote>
  
  <p>This is my PHP code:</p>
  
  <pre><code>&lt;?php
  $lang = "english";
  header('Content-Type: text/html; charset=UTF-8');
  require '../security.php';
  $con=mysqli_connect($sec[0],$sec[1],$sec[2],$lang);
  // Check connection
  if (mysqli_connect_errno()) {
    echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
  if (!$con-&gt;set_charset("utf8")) {
  } else {
  }
  
  $result = mysqli_query($con,"INSERT INTO `ta_exp` (`date`, `cargo`, `DP`, `LP`, `url`)
  VALUES ('".mysqli_real_escape_string($con,$_GET['date_exp'])."','".mysqli_real_escape_string($con,$_GET['cargo_exp'])."','".mysqli_real_escape_string($con,$_GET['lp_exp'])."','".mysqli_real_escape_string($con,$_GET['dp_exp'])."','".mysqli_real_escape_string($con,$_GET['url'])."')");
  
  if (!mysqli_query($con,$result)) {
    die('Error: ' . mysqli_error($con));
  }
  echo "added";
  
  mysqli_close($con);
  ?&gt;
  </code></pre>