#38472 [Opn->Fbk]: PDO bindParam
| From: | tony2001@php.net | Date: | Wed, 16 Aug 2006 14:53:59 +0000 |
| Subject: | #38472 [Opn->Fbk]: PDO bindParam | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-100866@lists.php.net to get a copy of this message | ||
ID: 38472
Updated by: tony2001@php.net
Reported By: chicodicherry at hotmail dot com
-Status: Open
+Status: Feedback
Bug Type: PDO related
Operating System: Windows XP Pro
PHP Version: 5.1.4
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:
------------------------------------------------------------------------
[2006-08-16 14:43:40] chicodicherry at hotmail dot com
Description:
------------
Pdo do not bindParam´s
if bindParams is used and after that execute returns false for any
cases?!?
Reproduce code:
---------------
public function getAll($amount = null, $offset = null)
{
$limit = null;
if ($amount !== null)
{
$limit = "LIMIT ".(int)$amount;
if ($offset !== null)
{
$limit = "LIMIT ".(int)$offset.", ".(int)$amount;
}
}
$stmt = $this->prepare("SELECT * FROM contents :LIMIT");
$stmt->bindParam(':LIMIT' => $limit);
$stmt->execute();
$ret = array();
while($row = $stmt->fetchObject('some class'))
{
$ret[] = $row;
}
return $ret;
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38472&edit=1