everything you need is here http://www.php.net/manual/en/ref.filesystem.php
in particular fopen(), fputs(), fwrite(), etc. Tim Ward http://www.chessish.com mailto:[EMAIL PROTECTED] ----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, December 06, 2002 1:25 PM Subject: [PHP] Output of MySQl sorted query to text or Word file. > > I've got a routine that queries a MySQL database and outputs the sorted > results to a web page (script snippet below.) How can I output the exact > same thing to a txt file using this script? > > <? > > $count = 0; > > $result = mysql_query ("SELECT * FROM listings ORDER by a > DESC"); > > if ($row = mysql_fetch_array($result)) { > > do { ?> > > > <? echo $row['company_name']; ?> > > <? echo $row['agent_name']; ?> > > <? echo $row['county']; ?> > > <? echo $row['city']; ?> > <br> > <? echo $row['mls']; ?> > > $<? echo number_format($row['price'], ","); ?> > > <? echo $row['area']; ?> > <br> > <? echo $row['copy']; ?> > <br> > <? echo $row['agent_name']; ?> > <p> > > <? > $count++; > > if ($count == 8) { > > echo "<hr><b>Page Break</b><hr><p>"; > $count = 0; > } > > } > > while($row = mysql_fetch_array($result)); > > mysql_close(); } ?> > > Thanks in advance for any ideas > > Ed > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php