MySQLi Drop Table

MySQLi DROP TABLE command is used to delete a table from the database.

Below the syntax of drop a table from database

DROP TABLE table_name;
<?php
   $conn  = mysqli_connect('localhost:3306', 'user_name', 'password', 'db_nexladder');
   if(! $conn) {
       die('Could not connect: ' . mysqli_error());
   }
   $sql = "DROP TABLE `tbl_customers`";
   if (mysqli_query($conn, $sql)) { 
     echo "Table deleted successfully";
   } else { 
     echo "Error:". mysqli_error($conn); 
   }
   mysqli_close($conn);
 ?>

Output: Table deleted successfully