#35675 [Opn->Asn]: pg_execute changes the type of passed parameters
| From: | tony2001@php.net | Date: | Fri, 16 Dec 2005 10:52:10 +0000 |
| Subject: | #35675 [Opn->Asn]: pg_execute changes the type of passed parameters | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-90536@lists.php.net to get a copy of this message | ||
ID: 35675
Updated by: tony2001@php.net
Reported By: david at tulloh dot id dot au
-Status: Open
+Status: Assigned
Bug Type: PostgreSQL related
Operating System: Debian Linux
PHP Version: 5.1.1
-Assigned To:
+Assigned To: helly
New Comment:
Marcus, I don't think it can be fixed, but please take a look at it.
Previous Comments:
------------------------------------------------------------------------
[2005-12-15 07:19:49] david at tulloh dot id dot au
work around until it's fixed and for older versions:
$type = gettype($i);
@pg_execute('dummy_entry', array($i) );
settype($i, $type);
------------------------------------------------------------------------
[2005-12-15 02:14:11] david at tulloh dot id dot au
Description:
------------
pg_execute will change the type of a passed parameter into a string.
Reproduce code:
---------------
<?php
$i = 42;
var_dump($i);
pg_pconnect("insert connect details here");
@pg_execute('dummy_entry', array($i) );
var_dump($i);
?>
Expected result:
----------------
int(42)
int(42)
Actual result:
--------------
int(42)
string(2) "42"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35675&edit=1