Virajsinh

DeleteRecord.php

Apr 2nd, 2018
59
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. if(isset($_POST['submit']))
  4. {
  5.     $uname = $_POST['username'];
  6.  
  7.     //MySQLi Query
  8.     $con = mysqli_connect("localhost","root","","mscit");
  9.    
  10.     if(!$con)
  11.     {
  12.         die("Error :".mysqli_error());
  13.     }
  14.     else
  15.     {
  16.         //none
  17.     }
  18.    
  19.     //delete from login where username=7842;
  20.  
  21.     $dbq = "delete from login where username='$uname'";
  22.    
  23.     mysqli_query($con, $dbq);
  24.    
  25.     echo "<p align='center'> Record Deleted.";
  26.    
  27.     //echo "Record Deleted : ".mysql_affected_rows($con);
  28. }
  29.  
  30. else
  31. {
  32.     header('Location: DeleteRecord.html');
  33. }
  34. ?>
RAW Paste Data