#49789 [Opn->Bgs]: I want to make a query like this "UPDATE class=? WHERE user IN (?)"

From: Date: Tue, 06 Oct 2009 15:03:59 +0000
Subject: #49789 [Opn->Bgs]: I want to make a query like this "UPDATE class=? WHERE user IN (?)"
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-143326@lists.php.net to get a copy of this message
ID: 49789 Updated by: sjoerd@php.net Reported By: seniuk01 at yahoo dot com -Status: Open +Status: Bogus Bug Type: PDO related Operating System: IRELEVANT PHP Version: 5.3.0 New Comment: Thank you for your bug report. The behavior you want is neither supported by prepared statements or by PDO. Also, this is properly documented: pdostatement.execute.php: You cannot bind multiple values to a single parameter; for example, you cannot bind two values to a single named parameter in an IN() clause. Previous Comments: ------------------------------------------------------------------------ [2009-10-06 14:52:49] seniuk01 at yahoo dot com Description: ------------ I want to make a query like this "UPDATE class=? WHERE user IN (?)" $sth = $DBH->prepare($query); try { $sth->execute(array('class1',$an_array)); } catch(PDOException $e) { die("PDO error: ".$e->getMessage()." (".__FILE__." ".__LINE__.")"); } So I expect this to work .... but it didn't. :( Reproduce code: --------------- --- From manual page: book.pdo --- ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=49789&edit=1

« previous php.bugs (#143326) next »