#46294 [Opn->Fbk]: pg_send_query_params converts all elements in 'params' to strings
| From: | iliaa@php.net | Date: | Tue, 14 Oct 2008 22:41:25 +0000 |
| Subject: | #46294 [Opn->Fbk]: pg_send_query_params converts all elements in 'params' to strings | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-129699@lists.php.net to get a copy of this message | ||
ID: 46294
Updated by: iliaa@php.net
Reported By: rob dot linton at donatgroup dot com
-Status: Open
+Status: Feedback
Bug Type: PostgreSQL related
Operating System: Windows XP
PHP Version: 5.2.6
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.3-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
Previous Comments:
------------------------------------------------------------------------
[2008-10-14 22:32:00] rob dot linton at donatgroup dot com
Description:
------------
This is just as described here:
http://bugs.php.net/bug.php?id=43279
Variables passed into the $params array of pg_send_query_params() are
converted to strings as if they were passed by reference.
Reproduce code:
---------------
$pg = pg_connect();
$int = null;
$int2 = 99;
echo '$int = '.var_export($int, true).'<br />';
echo '$int2 = '.var_export($int2, true).'<br /><br />';
$q = 'INSERT INTO val (val_int, val_int2) VALUES($1, $2)';
pg_send_query_params($pg, $q, array($int,$int2));
$result = pg_get_result($pg);
echo '$int = '.var_export($int, true).'<br />';
echo '$int2 = '.var_export($int2, true).'<br /><br />';
Expected result:
----------------
$int = NULL
$int2 = 99
$int = NULL
$int2 = 99
Actual result:
--------------
$int = NULL
$int2 = 99
$int = ''
$int2 = '99'
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46294&edit=1