Webbserv1: Källkod
Webbserverprogrammering 1

Show sourcecode

The following files exists in this folder. Click to view.

webbsrvprg/projects/slutprojekt/

blala.php
createtable.php
deletetable.php
deletetables.php
login.php
signup.php
verify.php

deletetable.php

50 lines ASCII Windows (CRLF)
<!-- deletetable.php -->
<!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 webusers";
    
//use exec() because no results are returned
    
$dbconn->exec($sql);
    echo 
"Table deleted successfully";

    
$sql "DROP TABLE IF EXISTS pictures";
    
//use exec() because no results are returned
    
$dbconn->exec($sql);
    echo 
"Table deleted succesfully";

    
$sql "DROP TABLE IF EXISTS interests";
    
//use exec() because no results are returned
    
$dbconn->exec($sql);
    echo 
"Table deleted successfully";
    
    
$sql "DROP TABLE IF EXISTS friends";
    
//use exec() because no results are returned
    
$dbconn->exec($sql);
    echo 
"Table deleted successfully";

    
$sql "DROP TABLE IF EXISTS messages";
    
//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>