Bug #68572 [Opn->Nab]: [PHP Modules] apc bcmath bz2 calendar Core ctype curl date dba dom ereg exif fi
| From: | mbeccati@php.net | Date: | Tue, 03 Feb 2015 10:21:22 +0000 |
| Subject: | Bug #68572 [Opn->Nab]: [PHP Modules] apc bcmath bz2 calendar Core ctype curl date dba dom ereg exif fi | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-190437@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=68572&edit=1
ID: 68572
Updated by: mbeccati@php.net
Reported by: me at free6k dot ru
Summary: [PHP Modules] apc bcmath bz2 calendar Core ctype
curl date dba dom ereg exif fi
-Status: Open
+Status: Not a bug
Type: Bug
Package: PDO PgSQL
Operating System: Debian 7.7 Wheezy
PHP Version: 5.4.35
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to write to us, but this is not
a bug.
Postgres doesn't support preparing a SET TIME ZONE query: http://www.postgresql.org/docs/9.4/static/sql-prepare.html
(And PDO_pgsql will try to prepare it, since you are using a parameter)
You could either generate the query manually (using PDO::quote) or temporarily using:
$pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
Previous Comments:
------------------------------------------------------------------------
[2014-12-09 06:50:39] me at free6k dot ru
Description:
------------
I have the following problem with binding params in pdo for sql requests
Test script:
---------------
$timezone = 'Asia/Jakarta';
$statement = $pdo->prepare('SET TIME ZONE :timezone');
$statement->execute([':timezone'=>$timezone]);
Actual result:
--------------
PDOException
SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "$1"
LINE 1: SET TIME ZONE $1
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=68572&edit=1