David,<br><br>Try the escapeshellcmd php function.<br><a href="http://www.php.net/manual/en/function.escapeshellcmd.php">http://www.php.net/manual/en/function.escapeshellcmd.php</a><br><br><div class="gmail_quote">On Thu, May 19, 2011 at 3:10 PM, Kidd, David M <span dir="ltr"><<a href="mailto:d.kidd@imperial.ac.uk">d.kidd@imperial.ac.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div>
<div><font face="Arial" size="2"><span>Hi,</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>I am trying to export spatial data from a Postgres/PostGIS table with upper-case field names by calling ogr2ogr from PHP shell_exec(). I am currently working on a Windows XP machine, but also
need to port to LINUX.</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>I know I have to escape double qoutes, but have so far have not worked out how to do this correctly.</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>The following works at the command line but fails when called with PHP shell_exec()</span></font></div>
<br>
<font face="Arial" size="2">"C:\FWTools2.4.7\bin\ogr2ogr" -f "ESRI Shapefile" test.shp PG:"<span><connect_str></span>" -sql "SELECT * FROM gpdd.location_pt WHERE \"LocationID\" = ANY(Array[1,2,3])"</font>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>I have tried escaping the slashes with one or two preceeding shashes but to no avail.</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>Any suggestions greatly appreciated. Thanks,</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span> - Dave</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"></font> </div>
<p align="left"><font size="2">David M. Kidd</font></p>
<p align="left"><font size="2">Research Associate<br>
Center for Population Biology<br>
Silwood Park Campus<br>
Imperial College London<br>
0207 594 2470</font></p>
<div> </div>
</div>
<br>_______________________________________________<br>
FWTools mailing list<br>
<a href="mailto:FWTools@lists.maptools.org">FWTools@lists.maptools.org</a><br>
<a href="http://lists.maptools.org/mailman/listinfo/fwtools" target="_blank">http://lists.maptools.org/mailman/listinfo/fwtools</a><br>
<a href="http://fwtools.maptools.org/" target="_blank">http://fwtools.maptools.org/</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Best regards,<br>Chaitanya kumar CH.<br>/tʃaɪθənjə/ /kʊmɑr/ <br>+91-9494447584<br>17.2416N 80.1426E<br>