On Thu, 23 May 2002, Manisha wrote: > I have one file with following format > > No. | Name | Email | status > 1 | Manisha | [EMAIL PROTECTED] | Pending > 2 | Neha | [EMAIL PROTECTED] | Reject > 3 | Aish | [EMAIL PROTECTED] | Pending > > ....... > > I want to update status change against that line. e.g For sr no 1 - I want > to change the status from Pending to Accepted. I read about the fseek / > fwrite command, but did not came across the delete the line from file. I > believe fseek command will write a line starting from pointer but will not > overwrite. > > I am using PHP3 and no database is available (That's the main problem). And > many times I need to seek the record (line) , change it and store back.
1. Make a database available. It'll make your life much easier. 2. As an alternative, pad your records out so they're all the same length (for instance, 100 characters). Then you can fseek() to $recordNum * 100 and write over records in place without having to rewrite the entire file. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php