|  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
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-2023 The PHP Group
All rights reserved.
Last updated: Wed Mar 22 11:03:40 2023 UTC