Virajsinh

DeleteRecord.php

Apr 2nd, 2018
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.52 KB | None | 0 0
  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. ?>
Add Comment
Please, Sign In to add comment