Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Gaetan Carabetta
projet_nf17_p19_tdg1_groupe2
Commits
8e5a493a
Commit
8e5a493a
authored
Jun 19, 2019
by
Osvaldo Valdivia Salas
Browse files
Upload New File
parent
1c67f6ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
application/remAnimal.php
0 → 100644
View file @
8e5a493a
<html>
<head>
<title>
Exercice
</title>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
>
</head>
<body>
<?php
$vHost
=
'tuxa.sme.utc'
;
$vPort
=
'5432'
;
$vData
=
'dbbdd0p117'
;
$vUser
=
'bdd0p117'
;
$vPass
=
'LpIHl1sZ'
;
try
{
$vConn
=
new
PDO
(
"pgsql:host=
$vHost
;port=
$vPort
;dbname=
$vData
"
,
$vUser
,
$vPass
);
}
catch
(
PDOException
$e
){
echo
"Erreur de connection '
$e
'"
;
}
try
{
$idAnimal
=
$_POST
[
'idAnimal'
];
//TODO Valider que l'id reçu existe
if
(
$idAnimal
!=
""
){
$vSql
=
"DELETE FROM posologie P WHERE P.traitement IN (SELECT idTraitement FROM traitement WHERE idAnimal='
$idAnimal
');"
;
$vSt
=
$vConn
->
prepare
(
$vSql
);
$vSt
->
execute
();
$vSql
=
"DELETE FROM traitement WHERE idAnimal='
$idAnimal
';"
;
$vSt
=
$vConn
->
prepare
(
$vSql
);
$vSt
->
execute
();
$vSql
=
"DELETE FROM animal WHERE idAnimal='
$idAnimal
';"
;
$vSt
=
$vConn
->
prepare
(
$vSql
);
$vSt
->
execute
();
header
(
'Location: http://tuxa.sme.utc/~bdd0p117/animal.php'
);
}
else
echo
"Il manque une donnée"
;
}
catch
(
PDOException
$e
){
echo
"Erreur de suppresion '
$e
'"
;
}
?>
</body>
</html>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment