Can't modify DBM key
| From: | David Scherfgen | Date: | Sun, 15 Oct 2000 10:02:00 +0000 |
| Subject: | Can't modify DBM key | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-3620@lists.php.net to get a copy of this message | ||
Hi.
I have the following problem:
When I run this script, "TestValue" appears on the screen (but it should
not):
$file = dbmopen("test", "c");
dbminsert($file, "TestKey", "TestValue");
dbmclose($file);
$file = dbmopen("test", "c");
dbmdelete($file, "TestKey");
dbmclose($file);
$file = dbmopen("test", "c");
$data = dbmfetch($file, "TestKey");
echo $data;
dbmclose($file);
You see, "TestValue" should not appear on the screen
because the key has been deleted with "dbmdelete".
After the call, the database files are modified.
But they don't get smaller but bigger!
Is this OK? Shouldn't they get smaller when I delete something?
Will the files grow for ever? Does an optimization function exist for DBM
files?
Why is the key not deleted?
Thank you
David Scherfgen