|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests |
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 16 16:00:01 2025 UTC |
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