locbtran Posted October 4, 2012 Share Posted October 4, 2012 I figure out how to write all the entries from my database onto a text file. header("Content-Type: text/plain");header("Content-Disposition: Attachment; filename=test.txt");header("Pragma: no-cache");exit; How do I modify the text file??Each entries (or row) have 5 elements in it and there are multiple entries in my database.How do I write each elements follow by a comma onto a text file? Each row in the database would have a new line in my text file as well.tks Link to comment Share on other sites More sharing options...
Ingolme Posted October 4, 2012 Share Posted October 4, 2012 You now have to query the database and print out the results, of course. You're not actually writing to a text file, just generating one. Link to comment Share on other sites More sharing options...
locbtran Posted October 4, 2012 Author Share Posted October 4, 2012 I'm thinking of writing all my sql onto an array then use a loop to go through each element in the arrayBut how would I be able to break up each entries so I can put it into an arraySo a row can have let say 3 entries and each entries can have more then one word in it SQL Entries:Name | Age | CountryJohn Adam Smith | 37 | USASteve Jones | 22 | Canada Also, how do I know when I reach the end of the row, so I can add in a new line. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now