title: How to delete data in Mysql using Php
body: <p>hello guys im having a hard time figuring how to delete data in database using php im using MYSQLI because mysql gives me warning i tried so many times but failed here is the code.HERE IS THE PICTURE:<a href="http://prntscr.com/8oll8k" rel="nofollow">PICTURE ERROR</a></p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;html&gt;
      &lt;head&gt;
      &lt;style&gt;
         .wrap{
             width:800px;
             margin:0px auto;
  
         }
        form{
            margin-left:200px;
  
  
        }
        a,a:visited{
            text-decoration:none;
            color:black;
        }
      &lt;/style&gt;    
      &lt;/head&gt;
      &lt;body&gt;
      &lt;?php
      require('connect.php');
          if(isset($_POST['Submit'])){
              $sid=$_POST['name'];
              $sql = "DELETE scholars ". "WHERE sid = $sid";
               $retval = $mysqli-&gt;query($sql,$mysqli );
  
              if(!$retval )
              {
                 die('Could not delete data: ' . $mysqli-&gt;error);
              }
  
              echo "Deleted data successfully\n";
  
              $mysqli-&gt;close( );
           }  
  
  
  
      ?&gt;
      &lt;div class="wrap"&gt;
      &lt;form action="dscholar.php" method="POST"&gt;
       &lt;table&gt;
          &lt;tr&gt;
          &lt;td&gt;ScholarID:&lt;/td&gt; 
          &lt;td&gt;&lt;input type="text" name="name" required&gt;&lt;td&gt;
          &lt;/tr&gt;
          &lt;td&gt;&lt;input type="submit" name="Submit" value="Delete Scholar"&gt;&lt;/td&gt;
          &lt;td&gt;&lt;button&gt;&lt;a href="index.html"&gt;Back to Homepage!&lt;/a&gt;&lt;/button&gt;&lt;/td&gt;
          &lt;/tr&gt;
  
       &lt;/table&gt;
      &lt;/form&gt;
      &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>HERE IS THE CONNECTION</strong></p>
  
  <pre><code>&lt;?php
  $mysqli=new mysqli("localhost","root","","dblogin");
  
  ?&gt;
  </code></pre>