RE: [PHP-DB] Example of dumping a query to a file
| From: | Boaz Yahav | Date: | Wed, 04 Oct 2000 19:26:17 +0000 |
| Subject: | RE: [PHP-DB] Example of dumping a query to a file | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-3325@lists.php.net to get a copy of this message | ||
#!/usr/local/bin/php -q
<?
include "connection.inc";
$result=mysql_query("SELECT Email,FirstName,LastName FROM MyTable") or
die(mysql_error());
$fp=fopen("Myfile.csv","w+");
While($row = mysql_fetch_object($result)) {
fputs($fp,"$row->Email,$row->FirstName,$row->LastName\n",1024);
}
fclose($fp);
?>
Sincerely
berber
Visit http://www.weberdev.com Today!!!
To see where PHP might take you tomorrow.
-----Original Message-----
From: Gary Robinson [mailto:grobinso@autocraft.com]
Sent: Tuesday, October 03, 2000 10:31 PM
To: php-db@lists.php.net
Subject: [PHP-DB] Example of dumping a query to a file
Does anyone have a simple example of dumping a query to a csv file?
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
For additional commands, e-mail: php-db-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net