-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinsereNumero.php
More file actions
50 lines (39 loc) · 1.11 KB
/
insereNumero.php
File metadata and controls
50 lines (39 loc) · 1.11 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<?php
require "connexion.php";
$CodeN=$_POST['CodeN'];
$Titre=$_POST['Titre'];
$Duree=$_POST['Duree'];
$CodeP=$_POST['CodeP'];
$req = $idcom->prepare("SELECT * FROM presentateur WHERE CodeP='$CodeP'");
$req->execute();
$count = $req->rowCount();
$req1= $idcom->prepare("SELECT * FROM numero WHERE CodeN='$CodeN' and Titre='$Titre' and Duree='$Duree'and CodeP='$CodeP'");
$req1->execute();
$count1 = $req1->rowCount();
if($count==0){
echo ("Code de numero n'existe pas ");
}
if($count1==0){
$req2 = $idcom->prepare("INSERT INTO numero VALUES ('$CodeN','$Titre','$Duree','$CodeP')");
$req2->execute();
$count2= $req2->rowCount();
if($count2>0){
echo ("Un numero est Ajouter Avec Succes");
}else{
echo ("Erreur");
}
}else{
echo ("Tu ne peux pas ajouter un numero avec ces conditions");
}
?>
</body>
</html>