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
Have you experienced this issue?
Rate the importance of this bug to you:

 [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

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Aug 23 23:01:26 2019 UTC