Output of MySQl sorted query to text or Word file.

From: Date: Fri, 06 Dec 2002 13:25:16 +0000
Subject: Output of MySQl sorted query to text or Word file.
Groups: php.general 
Request: Send a blank email to php-general+get-127247@lists.php.net to get a copy of this message
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']; ?> &nbsp;&nbsp; <? echo $row['agent_name']; ?> &nbsp;&nbsp; <? echo $row['county']; ?> &nbsp;&nbsp; <? echo $row['city']; ?> <br> <? echo $row['mls']; ?> &nbsp;&nbsp; $<? echo number_format($row['price'], ","); ?> &nbsp;&nbsp; <? 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

« previous php.general (#127247) next »