PHP code example of naftali100 / async-orm
1. Go to this page and download the library: Download naftali100/async-orm library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
naftali100 / async-orm example snippets
Amp\Loop::run(function(){
yield ORM::connect('127.0.0.1', 'user', 'pass', 'db');
$user = ORM::create('user');
$user->name = 'john';
$userid = yield ROM::store($user);
$same_user = yield ORM::load('user', $userid);
print $same_user->id; // id
print $same_user->name; // john
});