Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2006
    Posts
    105
    Plugin Contributions
    0

    Default Email Query Results as XLS or CSV

    I want to put a button on any admin page that runs a query and emails the result as an attachment. All I can find are suggestions to export, then attach them manually.

    Since at least 2007 there are many people here who want to email order information to suppliers, and most suggest they prefer XLS, but CSV would work. Unfortunately, it appears no one has ever created that solution.

    I know how to write SQL, but I don't know how to email the query results. Oddly, ZenCart supports email (it sends order confirmations), and PHPmyAdmin can export an XLS file.

    Can anyone help? Again, just looking to run any query (select * from zen_customers) and automatically send the results to a fixed email address (joe AT zenisfun DOT com) as an attachment (preferably XLS).

    Thanks
    DMFelder | Visit GreatApparelForYou.com for Chicago Direct to Garment printing and Chicago Screen Printing and for Funny Tees and shirts go to gafy.com. We also have Eco-Friendly Printing services.

  2. #2
    Join Date
    Nov 2006
    Posts
    105
    Plugin Contributions
    0

    Default Re: Email Query Results as XLS or CSV

    Maybe instead someone knows how to email anything as a CSV, PDF, whatever attachment?

    Again, extracting the data isn't the problem. I even know how to put query results into the body of an email. I just need to send an attachment for formatting reasons.
    DMFelder | Visit GreatApparelForYou.com for Chicago Direct to Garment printing and Chicago Screen Printing and for Funny Tees and shirts go to gafy.com. We also have Eco-Friendly Printing services.

  3. #3
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Email Query Results as XLS or CSV

    Using a program to type in an SQL query or even build one interactively, and then run it, is one thing.
    Having that program output it to a CSV or XLS or other file is yet another.
    And then attaching that file to an email is ... well ... another step you would do after that, on your own.

    But you're not asking for that.

    You're asking for something to automatically, without your interaction at all, determine which data to extract, dump that content to a file, and then generate an email with that file in it.

    It can certainly be done. But I suggest you offer to open your checkbook for whomever might consider writing such a tool for you. It's not a trivial task.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. Replies: 9
    Last Post: 12 Jul 2023, 12:26 AM
  2. v152 Query returns no results if an id value is selected
    By eComEvo in forum General Questions
    Replies: 3
    Last Post: 12 May 2015, 03:07 AM
  3. v138a PHP/Query For Export To CSV
    By [email protected] in forum General Questions
    Replies: 6
    Last Post: 11 Mar 2013, 02:49 PM
  4. Formatting SQL query results
    By haasPlay in forum Contribution-Writing Guidelines
    Replies: 1
    Last Post: 1 Aug 2008, 09:37 PM

Posting Permissions

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