require "config.php"; // database connection
$sql=$dbo->prepare("DROP TABLE student_del ");
$sql->execute();
After the query execution we will add message saying success or print error message in case of failure.
<?Php
require "config.php"; // database connection
$sql=$dbo->prepare("DROP TABLE student_del ");
if($sql->execute()){
echo " Table deleted ";
}else{
print_r($sql->errorInfo());
}
?>
In the above code we have used database connection code inside config.php file.
aliko | 25-01-2016 |
What about if I want to TRUNCATE A TABLE how would I do that? cheers |
smo1234 | 25-01-2016 |
Details about the TRUNCATE command is here. |