Ver Mensaje Individual
  #7 (permalink)  
Antiguo 24/11/2007, 16:23
Jarkaos
 
Fecha de Ingreso: noviembre-2002
Ubicación: Suecia
Mensajes: 253
Antigüedad: 21 años, 5 meses
Puntos: 2
Re: No puedo borrar!!

No me resulta, ahora he pedido el id del usuario solo para ver si la consulta funcionaba bien y cuando busco al usuario recibo el nombre y el id,es decir la consulta funciona bien, pero aun asi no puedo eliminar al usuario:

Código PHP:
<form method="post" action="">
                            Full name: <input type="text" name="fullName"/><br /><br />
                            <input type="submit" name="search" value="Hitta"/><br /><br />
                            <?php
                                 
if($_POST['search'] == "Hitta"){
                                    
$name $_POST[fullName];
                                    
$hitta mysql_query("SELECT * FROM glada_users WHERE fullname = '$name'");
                                    
$row mysql_fetch_array($hitta);
                                    
$user $row[fullname];
                                    
$id $row[userId];
                                    echo 
$user;
                                    echo 
$id;
                                    echo 
'<input type="submit" value="Radera" name="delete"/>';    
                                    if(
$_POST['delete'] == "Radera") {
                                         
mysql_query("DELETE FROM glada_users WHERE userId= '$id'");
                                        
                                    }
                                }
                                
                            
?>
Se necesitara algun permiso especial para eliminar registros de la base de datos? estoy conectandome como administrador.