php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44789 pg_execute() doesn't work (as documented?)
Submitted: 2008-04-20 21:14 UTC Modified: 2008-04-20 21:26 UTC
From: php at benjaminschulz dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.2CVS-2008-04-20 (CVS) OS: osx
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: php at benjaminschulz dot com
New email:
PHP Version: OS:

 

 [2008-04-20 21:14 UTC] php at benjaminschulz dot com
Description:
------------
This sample code is a customized version of the sample from http://php.net/pg_execute

Reproduce code:
---------------
$dbconn = pg_connect(...)

// Prepare a query for execution
$result = pg_prepare($dbconn, "my_query", 'SELECT $1');

// Execute the prepared query.  Note that it is not necessary to escape
// the string "Joe's Widgets" in any way
$result = pg_execute($dbconn, "my_query", array("Joe's Widgets"));

// Execute the same prepared query, this time with a different parameter
$result = pg_execute($dbconn, "my_query", array("Clothes Clothes Clothes"));

Expected result:
----------------
No errors ;)

Actual result:
--------------
Warning: pg_prepare(): Query failed: ERROR:  could not determine data type of parameter $1 in ...
Warning: pg_execute(): Query failed: ERROR:  prepared statement "my_query" does not exist in ...
Warning: pg_execute(): Query failed: ERROR:  prepared statement "my_query" does not exist in ...


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-04-20 21:26 UTC] php at benjaminschulz dot com
sorry.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 20 00:00:02 2025 UTC