-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocesa_baja_cliente.php
More file actions
40 lines (33 loc) · 928 Bytes
/
Copy pathprocesa_baja_cliente.php
File metadata and controls
40 lines (33 loc) · 928 Bytes
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
<?php
// conecto con el archivo conex.php que me da los datos de la BD
include("conex.php");
$usuario=$_GET['us'];
// verifico que se completaron los datos
$error=0;
// acá le decimos a a MYSQL que BORRE los datos del usuario
// SI NO PONEMOS EL WHERE SE MODIFICAN TODOS LOS USUARIOS, un desastre... ¬¬
if (!mysql_query("DELETE FROM clientes WHERE nombre_usuario='$usuario'", $link))
{
$error=2;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
</head>
<body>
<?php
if($error==0)
{
echo "Sus datos se borraron con éxito";
}
if($error==2)
{
echo "ERROR al intentar borrar los datos. Intente nuevamente.<br /> Ref:" .mysql_error($link);
}
?>
</body>
</html>
s