|
Posted by ZeldorBlat on 03/12/06 22:21
laredotornado@zipmail.com wrote:
> Hi,
>
> I have a client that wants to export his sales data into formats that
> can be imported into Quicken. Figured this kind of thing has been
> tackled before, but had trouble finding freeware on Google. Any
> suggestions on libraries/code to use when using PHP 4/MySQL 4 to export
> data to Quicken file formats (preferrably CSV).
>
> Thanks, - Dave
Turning a table into a CSV is easy:
$f = fopen('mycsvfile.csv', 'w');
$query = 'select * from someTable';
$rs = mysql_query($query);
while ($row = mysql_fetch_array($rs, MYSQL_NUM))
fwrite($f, implode(', ', $row) . "\n");
fclose($f);
Navigation:
[Reply to this message]
|