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; Code (markup): 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
Why would you do this? In most cases file based storage like this is an extremely inefficient way to store information. If you have to do it, I would use XML or something similar to maintain data integrity.
You could write a php script, where it auto-loads the text file into html form page view, and then modify and update using php. But I'd recommend keeping everything database related, may I ask why you're trying inefficient ways?