Advertisement
ikamal7

m7.php

Sep 6th, 2020
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.54 KB | None | 0 0
  1. <?php
  2. //MySQL Delete data
  3. $host     = 'localhost';
  4. $user     = 'root';
  5. $password = 'root';
  6.  
  7. $db_name = 'basicDB_2';
  8. //students_2
  9.  
  10. $mysql_conn = mysqli_connect( $host, $user, $password, $db_name );
  11.  
  12. if ( !$mysql_conn ) {
  13.     die( "Connection Failed" . mysqli_connect_error() );
  14. }
  15.  
  16. $sql = "DELETE FROM students_2 WHERE id=11";
  17.  
  18.     if(mysqli_query($mysql_conn, $sql)){
  19.         echo "Record Deleted Successfully";
  20.     }else{
  21.         echo "Error deleting failed" . mysqli_error($mysql_conn);
  22.     }
  23.  
  24.  
  25.  
  26.  
  27. mysqli_close( $mysql_conn );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement