// Connect to the database $db = dba_open('mydata.db', 'r', 'sqlite'); // Get all rows from a table $rows = dba_fetch_all($db); // Print out the results foreach ($rows as $row) { echo $row['id'] . ': ' . $row['name'] . '
'; } // Close the database connection dba_close($db);
// Connect to the database $db = dba_open('mydata.bdb', 'c', 'db4'); // Insert a new key-value pair dba_insert('mykey', 'myvalue', $db); // Retrieve a value by key $value = dba_fetch('mykey', $db); // Print out the result echo $value; // Close the database connection dba_close($db);Package library: PHP DBA (Database Access Abstraction)