Ver Mensaje Individual
  #3 (permalink)  
Antiguo 09/06/2012, 17:31
Avatar de jorges9
jorges9
 
Fecha de Ingreso: octubre-2011
Mensajes: 7
Antigüedad: 12 años, 6 meses
Puntos: 0
Respuesta: bindParam funciona a medias.

Código PHP:
Ver original
  1. $v2="UPDATE articulos SET precio=:precio ,descripcion=':texto', cantidad=:cant, descuento=:descuento where idarticulo=:idarticulo"; /// se debera añadir el nombre de la tabla origen
  2.         $vo=db::getStatement($v2);
  3.         $vo->bindParam(":precio", $v1, PDO::PARAM_INT);
  4.         $vo->bindParam(":texto", $v2, PDO::PARAM_STR);
  5.         $vo->bindParam(":cant", $v3, PDO::PARAM_INT);
  6.         $vo->bindParam(":descuento", $v4, PDO::PARAM_INT);
  7.                 $vo->bindParam(":idarticulo", $v5, PDO::PARAM_INT);
  8.         $vo->execute();

Es un ejemplo de prueba q puse, pero igualmente no me funciona, ignoro porque no me toma el bindparam..
En un insert que intente me añadio en el campo ':texto' o sea no me reemplaza la variable..