<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>
Thanks. Do you know how to run this in php. I am writting php file which query from postgres and produce xml file. Do you know how to do it with php?<BR>
<BR>
Thanks<BR> <BR>
<HR id=stopSpelling>
Date: Tue, 19 Oct 2010 21:54:11 +1000<BR>From: Josh.Preston@rpdata.com<BR>To: postgis-users@postgis.refractions.net<BR>Subject: Re: [postgis-users] create xml file from sql table<BR><BR>
<META content="Microsoft SafeHTML" name=Generator>
<STYLE>
.ExternalClass p.ecxMsoNormal, .ExternalClass li.ecxMsoNormal, .ExternalClass div.ecxMsoNormal
{margin-bottom:.0001pt;font-size:12.0pt;font-family:'Times New Roman','serif';}
.ExternalClass a:link, .ExternalClass span.ecxMsoHyperlink
{color:blue;text-decoration:underline;}
.ExternalClass a:visited, .ExternalClass span.ecxMsoHyperlinkFollowed
{color:purple;text-decoration:underline;}
.ExternalClass p
{margin-right:0cm;margin-left:0cm;font-size:12.0pt;font-family:'Times New Roman','serif';}
.ExternalClass p.ecxMsoAcetate, .ExternalClass li.ecxMsoAcetate, .ExternalClass div.ecxMsoAcetate
{margin-bottom:.0001pt;font-size:8.0pt;font-family:'Tahoma','sans-serif';}
.ExternalClass span.ecxEmailStyle18
{font-family:'Arial','sans-serif';color:windowtext;}
.ExternalClass span.ecxBalloonTextChar
{font-family:'Tahoma','sans-serif';}
.ExternalClass .ecxMsoChpDefault
{font-size:10.0pt;}
@page Section1
{size:612.0pt 792.0pt;}
.ExternalClass div.ecxSection1
{page:Section1;}
</STYLE>
<DIV class=ecxSection1>
<P class=ecxMsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">Hi,</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"> </SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">You can use psql to run your query from the command line.</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"> </SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">psql -At -U <I><SPAN style="COLOR: #ffc000">{username}</SPAN></I> -c “select table_to_xml(‘building3’,true,true,’’);” <I><SPAN style="COLOR: #ffc000">{database}</SPAN></I> > query.xml</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"> </SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">-A unaligned output (no formatting of results for display purposes)</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">-t Rows only (ie no header, so your xml file to only has xml in it)</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"> </SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">If you don’t really need an automated way you can use the “Execute query to file” option in pgAdmin.</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"> </SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">Regards,</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"> </SPAN></P>
<DIV>
<P class=ecxMsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">Josh</SPAN></P></DIV>
<P class=ecxMsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"> </SPAN></P>
<DIV>
<DIV style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: #b5c4df 1pt solid; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: medium none; PADDING-TOP: 3pt; BORDER-BOTTOM: medium none">
<P class=ecxMsoNormal><B><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">From:</SPAN></B><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'"> postgis-users-bounces@postgis.refractions.net [mailto:postgis-users-bounces@postgis.refractions.net] <B>On Behalf Of </B>zhang zhe<BR><B>Sent:</B> Tuesday, 19 October 2010 9:37 PM<BR><B>To:</B> postgis-users@postgis.refractions.net<BR><B>Subject:</B> [postgis-users] create xml file from sql table</SPAN></P></DIV></DIV>
<P class=ecxMsoNormal> </P>
<P class=ecxMsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">Hello,<BR> <BR>Does anyone knows how to generate xml file from postgres table. </SPAN></P>
<P class=ecxMsoNormal><SPAN lang=EN>select table_to_xml(‘building3’,true,true,’’);</SPAN></P>
<P class=ecxMsoNormal><SPAN lang=EN>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. </SPAN></P>
<P class=ecxMsoNormal> </P>
<P class=ecxMsoNormal><SPAN lang=EN>Thank you very much. </SPAN></P>
<P class=ecxMsoNormal> </P>
<P class=ecxMsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'"><BR>______________________________________________________________________<BR>This email has been scanned by the MessageLabs Email Security System.<BR>For more information please visit http://www.messagelabs.com/email <BR>______________________________________________________________________</SPAN></P></DIV><BR>_______________________________________________ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users </body>
</html>