Results 1 to 5 of 5

Thread: Export To CSV

  1. #1

    Thread Starter
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Export To CSV

    Is it possible to export the results of a query to a CSV file?

    If so, does anyone have an example?

  2. #2
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099

    Re: Export To CSV

    You have to do it yourself, so just loop though each value and each record and write them to a file with the delimator ',' or ';' splitting them up.

  3. #3

    Thread Starter
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Resolved Re: Export To CSV

    Thanks John, I thought that would be the solution.

  4. #4
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Export To CSV

    In mysql you can do it with a query:
    Code:
    SELECT * INTO OUTFILE 'c:\path\to\csv.csv'
      FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
      LINES TERMINATED BY '\r\n'
      FROM table_name;
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  5. #5
    Lively Member anjanesh's Avatar
    Join Date
    Nov 2002
    Location
    Nerul, Navi Mumbai, India
    Posts
    68

    Re: Export To CSV

    lintz - better still - use PHP5's fputcsv
    Trying out VB .NET 2005 Express

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width