#45857 [Opn->Fbk]: Apache crashes with Prepared Statements

[email protected]
Newsgroups php.bugs
Message-ID <[email protected]>
 ID:               45857
 Updated by:       [email protected]
 Reported By:      hawk_master at web dot de
-Status:           Open
+Status:           Feedback
 Bug Type:         PDO related
 Operating System: Win XP Prof
 PHP Version:      5.2.6
 New Comment:

Which database driver are you using and what kind of "crash" are you
getting?


Previous Comments:
------------------------------------------------------------------------

[2008-08-19 07:41:08] hawk_master at web dot de

Description:
------------
On my Win XP Prof System with Apache 2.2.9 and PHP 5.2.6 Apache will
crashes every time I run my PHP script which includes a Prepared
Statement and "bindParam"
If I replace the code without "bindParam" all is fine.

Reproduce code:
---------------
$dbUpdateUserLdap = $DBO->prepare("UPDATE table_user SET AddressField1
= :address1, AddressField2 = :address2', pwd = :pwd, AddressField3 =
:address3 WHERE usr = :user");
$dbUpdateUserLdap->bindParam(':user', $loginname);
$dbUpdateUserLdap->bindParam(':pwd', $_POST['PWD']);
$dbUpdateUserLdap->bindParam(':address1', $address1);
$dbUpdateUserLdap->bindParam(':address2', $address2);
$dbUpdateUserLdap->bindParam(':address3', $address3);
$dbUpdateUserLdap->execute();

This same code without "bindParam" will run:

$sql = "UPDATE table_user SET AddressField1='$address1' ,
AddressField2='$address2' , pwd='$_POST[PWD]', AddressField3='$address3'
WHERE usr='$loginname'";
$result = $DBO->exec($sql);



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=45857&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.