store data without db
| From: | kelvin | Date: | Wed, 30 Aug 2000 02:29:30 +0000 |
| Subject: | store data without db | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-14287@lists.php.net to get a copy of this message | ||
Hi,
I've problem with store data in textfile...
if ($do=="booking" && $no!="") {
$fp = fopen("database","r");
$data = fgets($fp,30000);
fclose($fp);
$data = ereg_replace("$no;0;Empty;\n", "$no;1;Some_name;\n", $data);
$fw = fopen("database","w");
$update = fputs($fw,$data);
fclose($fw);
}
the error i get, file 'database' only contain 1 line & the other line
are gone...
database file (there's 200 lines):
10;0;Empty;
11;0;Empty;
Kelvin