note 77039 deleted from pdostatement.bindparam by danbrown

From: Date: Tue, 17 May 2011 18:10:49 +0000
Subject: note 77039 deleted from pdostatement.bindparam by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-179831@lists.php.net to get a copy of this message
Note Submitter: bjornie at nowhere ---- I can't use wildcards in my prepared statements, using it like follows: $stmt = $pdh->prepare("SELECT id, uname FROM tbl WHERE uname LIKE :uname OR email LIKE :email OR firstname LIKE :fn OR lastname LIKE :ln"); $un = "%" . $un . "%"; $em = "%" . $em . "%"; $fn = "%" . $fn . "%"; $ln = "%" . $ln . "%"; $stmt->bindParam(":uname", $un); $stmt->bindParam(":email", $em); $stmt->bindParam(":fn", $fn); $stmt->bindParam(":ln", $ln); This is not giving me any error messages or exceptions, it's just not returning any rows. (And there are rows matching the query...) Running PHP5.2.3, MySQL5.0.45 and Apache2.2.4 in Windows.

« previous php.notes (#179831) next »