Hi David,

On Fri, Jan 09, 2004 at 11:04:21AM -0500, David T-G wrote:
> Tristan --
> 
> % Now I have found loadsa sites that let me upload a csv file, but not the 
> % other way around...
> 
> You might check PHPClasses to see if anyone has done this; I wouldn't be
> surprised.  In general, though, you declare the file type and then run
> through a loop.  From some code I have:
> 
>   header ("Content-Type: application/csv;") ;         # this is a CSV
>   header ("Content-disposition: attachment; filename=authorized-visitors.$d.csv") ;  
>  # file name
>   ...
>         [suck in file and dump into $a array]
>         foreach ( array_keys($a) as $ak )             # walk thru the array
>           { print "\"$a[$ak]\"," ; }                  # print the field (yes, even 
> if blank)

But this would go wrong if $a[$ak] contained a double quote. Remember you have
to escape those characters. Can't the database of OP do a dump, like MySQL
can?

[ rest of script stripped ]

-- 
Regards,

Andre

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to