|  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: -
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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
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
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']);

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


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Feb 20 21:01:28 2024 UTC