You are here: Re: [PHP] Delete a file immediately after download « PHP « IT news, forums, messages
Re: [PHP] Delete a file immediately after download

Posted by Richard Lynch on 10/04/76 11:08

Shaun wrote:
> Hi Marek,
>
> Thanks for your reply, could you tell me how I would go about this please?

<?php
require 'connect.inc';

$query = "select * from whatever";
$data = mysql_query($query);
while ($row = mysql_fetch_row($data)){
echo implode("\t", $data), "\n";
}
?>

You can muck around with CSV if you prefer, but tab-delimited is way
easier, assuming no tabs in your content.

This also assumes no newlines in your content.

If there are tabs and/or newlines in your content, you can use MySQL's
replace function (not the REPLACE INTO, but the string function 'replace')
to change tab to, err, \\t or something, and newline to Mac
carriage-return or something.

You'd have to do this (and more) to get CSV working right.

The on-line manual has example code for CSV at http://php.net/fputcsv

Maybe you should have googled before posting, eh?

--
Like Music?
http://l-i-e.com/artists.htm

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация