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



