-
Notifications
You must be signed in to change notification settings - Fork 0
/
removeEspaco.php
33 lines (29 loc) · 740 Bytes
/
removeEspaco.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<html>
<head>
<meta charset="UTF-8" />
</head>
<body>
<?php
$host = "db.ist.utl.pt";
$user ="ist181149";
$password = "111111";
$dbname = $user;
$codigo = $_REQUEST['codigo'];
try {
$db = new PDO("mysql:host=$host;dbname=$dbname", $user, $password);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
/* Codigo consulta / actualização */
$sql = "DELETE FROM espaco WHERE `codigo` = '" . $codigo . "';";
$stmt = $db->prepare($sql);
$stmt->bindParam(':codigo', $codigo, PDO::PARAM_STR);
$stmt->execute();
echo("Espaco removed succesfully");
$db = null;
}
catch (PDOException $e)
{
echo("<p>ERROR: {$e->getMessage()}</p>");
}
?>
</body>
</html>