php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73430 PostgreSQL 9.4, PostGIS 2.1
Submitted: 2016-10-31 11:17 UTC Modified: -
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: roman dot salnikov dot s at gmail dot com Assigned:
Status: Open Package: PDO PgSQL
PHP Version: 7.0.12 OS: Debian 8
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: roman dot salnikov dot s at gmail dot com
New email:
PHP Version: OS:

 

 [2016-10-31 11:17 UTC] roman dot salnikov dot s at gmail dot com
Description:
------------
I try to bind param for string. But it doesn't work.

Test script:
---------------
            $conn = new PDO('pgsql:host=localhost;dbname=base', 'login', 'pass');
            $stmt = $conn->prepare("select ST_Contains(ST_GeometryFromText('POLYGON((:downLeftPoint, :topLeftPoint, :topRightPoint, :downRightPoint, :downLeftPoint))'), POINT(100500,100500)::geometry)");
            $stmt->bindParam(':downLeftPoint', $coord['downLeftPoint']);
            $stmt->bindParam(':topLeftPoint', $coord['topLeftPoint']);
            $stmt->bindParam(':topRightPoint', $coord['topRightPoint']);
            $stmt->bindParam(':downRightPoint', $coord['downRightPoint']);
            $stmt->bindParam(':downLeftPoint', $coord['downLeftPoint']);
            $stmt->execute();

Expected result:
----------------
SQL query:

select ST_Contains(ST_GeometryFromText('POLYGON((100500 100500, 200500 200500, 300500 300500, 400500 400500, 100500 100500))'), POINT(100500,100500)::geometry)

Actual result:
--------------
Error: PDOStatement::bindParam(): SQLSTATE[HY093]: Invalid parameter number: :downLeftPoint

Patches

Pull Requests

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Oct 04 19:01:27 2024 UTC