dbase_pack

(PHP 4, PHP 5)

dbase_packPacks a database

說明

bool dbase_pack ( int $dbase_identifier )

Packs the specified database by permanently deleting all records marked for deletion using dbase_delete_record().

參數

dbase_identifier

The database link identifier, returned by dbase_open() or dbase_create().

回傳值

如果成功則回傳 TRUE,失敗則回傳 FALSE

範例

Example #1 Emptying a dBase database

<?php

// open in read-write mode
$db dbase_open('/tmp/test.dbf'2);

if (
$db) {
  
$record_numbers dbase_numrecords($db);
  for (
$i 1$i <= $record_numbers$i++) {
      
dbase_delete_record($db$i);
  }
  
// expunge the database
  
dbase_pack($db);
}

?>

參見

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top