<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Hello,<BR>
 <BR>
I am programming php application with postgres. I need to select the points which locate inside the polygon. Here is my code<BR>
<?php<BR>
$stringPolygonCoordinate="(35.1343 24.15454, 35.2454 24.2565,35.35675 24.3565,35.1343 24.15454)";<BR><SPAN lang=FI>
$query1 = "select attribute1, the_geom from table1 where st_contains(st_geomfromtext('POLYGON($stringPolygonCoordinate)'), table1.the_geom);<BR>
$result1= pg_query($query1) or die('Query failed: ' . pg_last_error());<BR>
pg_query("select sum(attribute2) from table2 where st_contains(st_geomfromtext('POLYGON($stringPolygonCoordinate)'), table2.the_geom) group by attribute3;") or die('Query failed: ' . pg_last_error());<BR>
 <BR>
?><BR>
But it doesn´t work. I wonder, does the polygon()function only take integer/float as input? Sinct $stringPolygonCoordinate variable is string? I also tried to modify the code like this<BR>
$query1 = "select attribute1, the_geom from table1 where st_contains(st_geomfromtext('POLYGON(to_number($stringPolygonCoordinate))'), table1.the_geom);<BR>
It also doesn´t work. If Polygon() doesnot accept string as input, how can I convert the string to Integer without using complicated for loop? Is there ready function in postgres? <BR>
 <BR>
Can anyone help me?<BR>
Thanks<BR>
 <BR></SPAN>                                     </body>
</html>