// Connect to database using PEAR::DB $db = DB::connect('mysql://user:password@localhost/mydatabase'); // Use DataObject to create recordset $people = DB_DataObject::factory('people'); $people->find(); // Disconnect database connection $db->disconnect();In this example, we connect to a MySQL database using PEAR::DB and then create a recordset using the DataObject library. Once we are done with the recordset, we disconnect from the database using the disconnect() function. The DataObject library can be found in the PEAR package repository.