Title: Streaming a CSV
Last modified: August 20, 2016

---

# Streaming a CSV

 *  [jract7](https://wordpress.org/support/users/jract7/)
 * (@jract7)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/streaming-a-csv/)
 * In my plugin, I have a table generated by a query… then I have the code to stream
   a CSV, it is working… but it is streaming the entire webpage _AND_ the database
   info to the file. My question is… where or how do I execute this code so I’m 
   only getting the database data into the CSV?
 * [Here is the code at pastebin](http://pastebin.com/8DBWZdnK)
 * _[Code moderated as per the [Forum Rules](http://codex.wordpress.org/Forum_Welcome#Posting_Code).]_

Viewing 1 replies (of 1 total)

 *  Thread Starter [jract7](https://wordpress.org/support/users/jract7/)
 * (@jract7)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/streaming-a-csv/#post-2348381)
 * The answer was to call the code inside(at the top) of my page template using 
   the $_POST function… That is not the solution I was looking for.. but it will
   work for now.
 * If anyone has an idea how to email that also.. that would be a great help

Viewing 1 replies (of 1 total)

The topic ‘Streaming a CSV’ is closed to new replies.

## Tags

 * [csv](https://wordpress.org/support/topic-tag/csv/)
 * [database](https://wordpress.org/support/topic-tag/database/)
 * [query](https://wordpress.org/support/topic-tag/query/)
 * [wpdb](https://wordpress.org/support/topic-tag/wpdb/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [jract7](https://wordpress.org/support/users/jract7/)
 * Last activity: [14 years, 7 months ago](https://wordpress.org/support/topic/streaming-a-csv/#post-2348381)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
