title: SQL syntax error; MySQL server version for the right syntax to use near '' at line 1
body: <p>I got "<strong>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 1</strong>" error only run file in some systems. But some system run file and got output.<br>
  values are coming from check box<br>
  My code is:<br></p>
  
  <pre><code>&lt;?php
  session_start();
  if(!isset($_SESSION['email']))
  {
  header("location:logout.php");
  }
  
  require 'database.php';
  if($_POST['delete']) // from button name="delete"
  {
  $checkbox = $_POST['checkbox']; //from name="checkbox[]"
  $countCheck = count($_POST['checkbox']);
  $checked = $_POST["checkbox"];
  for($i=0;$i&lt;$countCheck;$i++)
  {
  echo  $del_id  = $checkbox[$i];
  $sql = "DELETE from user where id = $del_id";
  $result = $mysqli-&gt;query($sql) or die(mysqli_error($mysqli));
  }
  }
  ?&gt;
  </code></pre>