$db = new DBCollection('users'); $user = $db->create([ 'name' => 'John Doe', 'email' => 'jdoe@example.com', 'password' => 'password', ]);
$db = new DBCollection('users'); $user = $db->findOne([ 'name' => 'John Doe', ]); $user->email = 'newemail@example.com'; $user->save();
$db = new DBCollection('users'); $users = $db->find([ 'age' => ['$gt' => 18], ]);This code returns all user records where the age field is greater than 18. Overall, PHP DB Collection is a lightweight and simple package library for database operations in PHP.