>From a user's standpoint, PostgreSQL (and <meta http-equiv="content-type" content="text/html; charset=utf-8">PostGIS) does not write files. In order to read/write files, you need tools (psql, pgAdminIII, pgsql2shp, etc.). You need to write a custom tool for your situation in PHP.<div>
<br></div><div>Ignoring details, you will need a database connection from PHP to PostgreSQL, run your query, and put the text result into PHP. Once PHP has this data, you can open a file in write mode and write the lines to the file.</div>
<div><br></div><div>-Mike<br><br><div class="gmail_quote">On 19 October 2010 04:37, zhang zhe <span dir="ltr"><<a href="mailto:luckyclare@hotmail.com">luckyclare@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>
Hello,<br>
<br>
Does anyone knows how to generate xml file from postgres table. <br>
<p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN"><font size="3"><font face="Times New Roman">select table_to_xml(‘building3’,true,true,’’);</font></font></span></p>
<p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN"><font size="3"><font face="Times New Roman">will print xml file in data output . How can I generate a file, and save it to directory automatically. I want to write this function in php code. </font></font></span></p>
<p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN"><font face="Times New Roman" size="3"></font></span> </p>
<p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN"><font face="Times New Roman" size="3">Thank you very much. </font></span></p>
<p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN"><font face="Times New Roman" size="3"></font></span> </p> </div>
<br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
<br></blockquote></div><br></div>