pfkdesign Posted April 21, 2010 Share Posted April 21, 2010 Hi everybody. I have some data in database, i need to create/update file when i update the database by submitting the form 1) the file must contain all the content in database 2) each time i generate or update the record, it must update(or rewrite on the file all the record + new record) any idea? Quote Link to comment https://forums.phpfreaks.com/topic/199285-database-to-file/ Share on other sites More sharing options...
premiso Posted April 21, 2010 Share Posted April 21, 2010 Don't use the file? Sounds extremely pointless, unefficient and did I mention pointless? If you want the file, instead of "updating" the file, just re-create the file from the data in the database. It will probably take just a long (depending on how much data) as it would be to open the file, traverse to the correct record, pull out that record modify it then read in the file and replace that record in the file and write it back to the harddrive. if you must do that for some weird and pointless requirement, just re-create the file each time, in my opinion. Quote Link to comment https://forums.phpfreaks.com/topic/199285-database-to-file/#findComment-1046044 Share on other sites More sharing options...
pfkdesign Posted April 21, 2010 Author Share Posted April 21, 2010 Don't use the file? Sounds extremely pointless, unefficient and did I mention pointless? If you want the file, instead of "updating" the file, just re-create the file from the data in the database. It will probably take just a long (depending on how much data) as it would be to open the file, traverse to the correct record, pull out that record modify it then read in the file and replace that record in the file and write it back to the harddrive. if you must do that for some weird and pointless requirement, just re-create the file each time, in my opinion. hi, i dont know how to do that! this is the problem, i have never made such this requirement Quote Link to comment https://forums.phpfreaks.com/topic/199285-database-to-file/#findComment-1046047 Share on other sites More sharing options...
Mchl Posted April 21, 2010 Share Posted April 21, 2010 Just enable binary log Quote Link to comment https://forums.phpfreaks.com/topic/199285-database-to-file/#findComment-1046053 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.