$factory = new ORMFactory('mysql:host=localhost;dbname=mydatabase', 'username', 'password'); $users = $factory->table('users'); $user = array( 'name' => 'John Doe', 'email' => 'johndoe@example.com', 'password' => 'mypassword' ); $users->insert($user);
$factory = new ORMFactory('mysql:host=localhost;dbname=mydatabase', 'username', 'password'); $users = $factory->table('users'); $user = $users->where('id', '=', 1)->get(); $user['name'] = 'John Smith'; $user['email'] = 'johnsmith@example.com'; $users->update($user);
$factory = new ORMFactory('mysql:host=localhost;dbname=mydatabase', 'username', 'password'); $users = $factory->table('users')->orderBy('name', 'asc')->get(); foreach ($users as $user) { echo $user['name'] . ' (' . $user['email'] . ')The above examples are just a few of the many ways you can use PHP ORM Factory. This package library is highly flexible and can be customized to meet the specific needs of your project.
'; }