<html><body><div style="color:#000; background-color:#fff; font-family:garamond, new york, times, serif;font-size:14px"><div id="yui_3_16_0_1_1420557992804_86241" dir="ltr">Hello,</div><div id="yui_3_16_0_1_1420557992804_86961" dir="ltr">I currently have a select which works correctly:</div><div id="yui_3_16_0_1_1420557992804_86960" dir="ltr"><br></div><div id="yui_3_16_0_1_1420557992804_86249" dir="ltr">$sth = $dbh->prepare("select ST_Asgeojson( geom ) from polys where ST_Intersects(ST_GeomFromText('POLYGON(($textPoly, $closingLon $closingLat))', 4269), geom)=TRUE");<br style="" class=""><br></div><div id="yui_3_16_0_1_1420557992804_86149"><div id="yui_3_16_0_1_1420557992804_86191"><br><div id="yui_3_16_0_1_1420557992804_86289" dir="ltr">I'm trying to do the same thing, using FromGeoJSON instead of Text. Below is my attempt, but it's not working. This is my statement, where $jsonPolys contains the JSON:</div><div id="yui_3_16_0_1_1420557992804_86302" dir="ltr"><br></div><div id="yui_3_16_0_1_1420557992804_86297" dir="ltr">$sth = $dbh->prepare("select ST_Asgeojson( geom ) from polys where ST_Intersects(ST_GeomFromGeoJSON('POLYGON(($jsonPolys))', 4269), geom)=TRUE");<br style="" class=""><br>
</div><div style="" class="" id="yui_3_16_0_1_1420557992804_86297" dir="ltr"> I think the problem has something to do with the POLYGON text, since it may not be necessary. But I can't get the syntax right.</div><div id="yui_3_16_0_1_1420557992804_86512" style="" class="" dir="ltr"><br></div><div id="yui_3_16_0_1_1420557992804_86712" style="" class="" dir="ltr">Any ideas?</div><div id="yui_3_16_0_1_1420557992804_86956" style="" class="" dir="ltr"><br>Thanks!</div><div id="yui_3_16_0_1_1420557992804_86957" style="" class="" dir="ltr"><br></div><div id="yui_3_16_0_1_1420557992804_86958" style="" class="" dir="ltr">Regards,</div><div id="yui_3_16_0_1_1420557992804_86959" style="" class="" dir="ltr">Joseph Spenner</div><div id="yui_3_16_0_1_1420557992804_86962" style="" class="" dir="ltr"><br></div></div></div></div></body></html>