#33724 [Opn->Fbk]: "PDO" object doesn't run in functions.
| From: | derick@php.net | Date: | Sat, 16 Jul 2005 12:03:14 +0000 |
| Subject: | #33724 [Opn->Fbk]: "PDO" object doesn't run in functions. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-81926@lists.php.net to get a copy of this message | ||
ID: 33724
Updated by: derick@php.net
Reported By: eser at turkishqf dot org
-Status: Open
+Status: Feedback
Bug Type: *Database Functions
Operating System: freebsd 4.3
PHP Version: 5.1.0b2
New Comment:
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php
If you can provide more information, feel free to add it
to this bug and change the status back to "Open".
Thank you for your interest in PHP.
Previous Comments:
------------------------------------------------------------------------
[2005-07-16 14:00:54] eser at turkishqf dot org
Description:
------------
"PDO" object doesn't run in functions.
Reproduce code:
---------------
$qDB = new PDO ...
function addToStorage($uId) { // doesn't work
global $qDB;
$tQuery = $qDB->prepare('SELECT * FROM
articles WHERE
idx=:idx');
print_r($tQuery);
}
// works
$tQuery = $qDB->prepare('SELECT * FROM articles WHERE
idx=:idx');
print_r($tQuery);
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33724&edit=1