Show sourcecode
The following files exists in this folder. Click to view.
webbsrvprg/exercises/databaser/databaser3/
car.php
createtables.php
databaser3.php
databaser3a.php
databaser3b.php
databaser3c.php
databaser3d.php
databaser3e.php
deletetables.php
garage.php
owner.php
start.php
deletetables.php
55 lines ASCII Windows (CRLF)
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Create</title>
</head>
<body>
<?php
include ('../../../dbconnection.php');
try {
// sql to delete table
$sql = "DROP TABLE IF EXISTS car";
//use exec() because no results are returned
$dbconn->exec($sql);
echo "Table deleted successfully";
}
catch(PDOException $e)
{
echo $sql . "<br>" . $e->getMessage();
}
try {
// sql to delete table
$sql = "DROP TABLE IF EXISTS garage";
//use exec() because no results are returned
$dbconn->exec($sql);
echo "Table deleted successfully";
}
catch(PDOException $e)
{
echo $sql . "<br>" . $e->getMessage();
}
try {
// sql to delete table
$sql = "DROP TABLE IF EXISTS owner";
//use exec() because no results are returned
$dbconn->exec($sql);
echo "Table deleted successfully";
}
catch(PDOException $e)
{
echo $sql . "<br>" . $e->getMessage();
}
//Rensa kopplingen till databasen
$dbconn = null;
?>
</body>
</html>