title: Deleting data from database using drop down list but got error message
body: <p>Error Message : Error deleting record: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '1' at line 1</p>
  
  <p>Success to delete but how to get rid of this error message</p>
  
  <p>Output.php</p>
  
  <pre><code>        mysqli_query($link, "CREATE TABLE Student (
              Student_Name VARCHAR(100),
              IC_Number VARCHAR(15),
              Matric_Number VARCHAR(10),
              PRIMARY KEY (Matric_Number)
          )");
  
          $stdname = $_POST["stdname"];
          $icno = $_POST["icno"];
          $matricno = $_POST["matricno"];
  
          $data = "INSERT INTO Student (Student_Name, IC_Number, Matric_Number) 
          VALUES ('$stdname', '$icno', '$matricno')";
  </code></pre>
  
  <p>delete_form.php</p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;html&gt;
  &lt;body&gt;
  &lt;form action="todelete.php" method="post"&gt;
  &lt;h2&gt;Delete Student&lt;/h2&gt;
      &lt;select name = "dropdownlist"&gt;
      &lt;?php
          $link = mysqli_connect("localhost", "root", "") or die(mysqli_connect_error());
  
          mysqli_select_db($link, "myDataBase") or die(mysqli_error($link));
  
          $result = mysqli_query($link, "SELECT Matric_Number FROM Student");
  
          while($row = mysqli_fetch_array($result)){ 
              echo "&lt;option value ='" . $row['Matric_Number'] . "'&gt;" . $row['Matric_Number'] . '&lt;/option&gt;';
          } 
  
          mysqli_close($link); 
      ?&gt;
      &lt;input type="submit" value="Delete"&gt;
      &lt;/select&gt;
  &lt;form&gt;  
  &lt;br&gt;&lt;br&gt;
  &lt;a href= "view_student.php"&gt;Click here to list the table&lt;/a&gt;
  &lt;/body&gt; 
  &lt;/html&gt;
  </code></pre>
  
  <p>todelete.php</p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;html&gt;
  &lt;body&gt;
      &lt;?php
          $link = mysqli_connect("localhost", "root", "") or die(mysqli_connect_error());
  
          mysqli_select_db($link, "myDataBase") or die(mysqli_error($link));
  
          if(isset($_POST['dropdownlist'])){
          $dropdownlist1 =  $_POST['dropdownlist'];
  
          $result = mysqli_query($link, "DELETE FROM Student WHERE Matric_Number = '$dropdownlist1'");
  
          if (mysqli_query($link, $result)){
              echo "Record deleted successfully";
          } else {
              echo "Error deleting record: " . mysqli_error($link);
          }
          }
          mysqli_close($link);
      ?&gt;
  &lt;br&gt;&lt;br&gt;
  &lt;a href= "view_student.php"&gt;Click here to list the table&lt;/a&gt;
  &lt;/body&gt; 
  &lt;/html&gt;
  </code></pre>