Webbserverprogrammering 1

Show sourcecode

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

webbserverprogrammering/projekt/GYA-2026/php/

config.php
createTables.php
dbconnection.php
deleteActions.php
deletePlayers.php
index.php
main.php
map_maker.html
seePlayers.php

deletePlayers.php

29 lines ASCII Windows (CRLF)
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Delete Players</title>
</head>

<body>
<?php
include ('dbconnection.php');
try {

    
// sql to delete table
    
$sql "DROP TABLE IF EXISTS players";
    
//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>