-
Notifications
You must be signed in to change notification settings - Fork 0
/
delete_clients.php
38 lines (36 loc) · 950 Bytes
/
delete_clients.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
34
35
36
37
38
<?php
session_start();
if($_SESSION["autentificado"]!= "SI"){
header("Location: index.php?errorusuario=si");
exit();
}
?>
<!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>Fran Quiles</title>
</head>
<body>
<?php
include("conexion.php");
$arrayBorrados=$_POST["borrar"];
$error=0;
for($i=0; $i<count($arrayBorrados);$i++)
{
$sentenciaSQL="DELETE from clientes where Id_Cliente='$arrayBorrados[$i]'";
$result=$conn->query($sentenciaSQL);
if(!$result)
{
$error=1;
}
}
if($error==0)
{
echo "<br><br>El (Los) Clientes (s) se ha (n) eliminado correctamente.";
}
?>
</body>
</html>