FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Send .csv file to browser
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Send .csv file to browser [message #170018 is a reply to message #170008] Tue, 05 October 2010 17:54 Go to previous messageGo to previous message
sheldonlg is currently offline  sheldonlg
Messages: 166
Registered: September 2010
Karma:
Senior Member
On 10/5/2010 11:14 AM, Captain Paralytic wrote:
> On 5 Oct, 16:06, Derek Turner<frde...@cesmail.net> wrote:
>> On Tue, 05 Oct 2010 10:55:44 -0400, sheldonlg wrote:
>>> The user can then cut and paste it into a file or you can put in code
>>> for the user to download that piece.
>>
>>> Another approach is to output an Excel file and the user can then output
>>> from that Excel file to a .csv file.
>>
>> Why not? Because it's not very elegant, is it?
>
> Well before anyone else wastes time coming up with other answers, you
> had better tell us your elegance criteria.
>
> Personally I think that Shelly's solution is very compact and with the
> suggested download code would fit what you want, except that his
> solution does not require the intermediate local file and readfile().

Thanks Captain. Simple to me equals elegant.

BTW, I thought of even simplifying it (after the suitable db login stuff):

$sql = "The actual sequel call";
$rsc = mysql_query($sql);
while ($row = mysql_fetch_array($rsc)) {
print implode(',', $row) . '<br>';
}

No need to even create an array of rows.

--
Shelly
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: file access permission?
Next Topic: Process queue without cron jobs
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 12:24:04 GMT 2024

Total time taken to generate the page: 0.04822 seconds