Ver Mensaje Individual
  #5 (permalink)  
Antiguo 01/09/2011, 08:55
Myl
 
Fecha de Ingreso: agosto-2011
Mensajes: 61
Antigüedad: 12 años, 8 meses
Puntos: 3
Respuesta: Problema Call to a member function bind_param() on a non-object

Si lo hago asi, da error en el segundo bind_param

Código PHP:
require_once('conexion.php');
$conexion conectar();
$id $_GET["id"];

$sql "SELECT EMAIL FROM USUARIO WHERE ID = ?";
$statement $conexion -> prepare($sql);
$statement -> bind_param("i"$id);
$statement -> execute();
$statement -> bind_result($email);
$statement -> fetch();
$statement -> close();

if(isset (
$email)){
    
$sql "UPDATE USUARIO SET ESTADO = 1 WHERE ID = ?";
    
$statement $conexion -> prepare($sql);
    
$statement -> bind_param("i",$id); <--- AQUI

    
if($statement -> execute()){
        echo 
"Bien";
    }
    
$statement -> close();
}
$conexion -> close();