Ver Mensaje Individual
  #3 (permalink)  
Antiguo 23/01/2012, 09:09
Avatar de RIVERMILLOS
RIVERMILLOS
 
Fecha de Ingreso: marzo-2010
Mensajes: 1.336
Antigüedad: 14 años, 2 meses
Puntos: 15
Respuesta: problema con pdo e insert y parametro

Hola muchas gracias por tu respuesta haciendo pruebas , cambie la consulta con asii y tampoco me funciona con bindparam y lo cambie a bindValue y si.

Código PHP:
Ver original
  1. $daily = '{"amount":0,"accumulated":0}';
  2.                            
  3.                             $insert = 'INSERT INTO usuarios (idufb,nick,money,gas,phone,address,mail,daily
  4.                            ,ultiposi,idlevel,idavatars,city,idciudad, dailyrents, dailytimeto)
  5.                            VALUES (? , ? , ? , ? , ? , ? ,?, NOW(), ? , 1, 1, ? ,? , ? ,?)';
  6.  
  7.                             $stmt_insert = $this->conn->prepare( $insert );
  8.  
  9.                             $stmt_insert->bindValue(1 , $this->idufb,PDO::PARAM_STR);
  10.                             $stmt_insert->bindValue(2 , $this->nickname,PDO::PARAM_STR);
  11.                             $stmt_insert->bindValue(3 , $this->money,PDO::PARAM_INT);
  12.                             $stmt_insert->bindValue(4 , $this->gas,PDO::PARAM_STR);
  13.                             $stmt_insert->bindValue(5 , $this->phone,PDO::PARAM_STR);
  14.                             $stmt_insert->bindValue(6 , $this->address,PDO::PARAM_STR);
  15.                             $stmt_insert->bindValue(7 , $this->mail,PDO::PARAM_STR);
  16.                             $stmt_insert->bindValue(8 , $this->point,PDO::PARAM_STR);
  17.                             $stmt_insert->bindValue(9,  $city,PDO::PARAM_STR);
  18.                             $stmt_insert->bindValue(10, $idcity,PDO::PARAM_STR);
  19.                             $stmt_insert->bindValue(11, $daily,PDO::PARAM_STR);
  20.                             $stmt_insert->bindValue(12, $daily,PDO::PARAM_STR);

con bindValue me funciona no se porque con bindParam no ?


saludos