require 'rb.php';
R::setup( 'mysql:host=localhost;dbname=mydatabase',
'user', 'password' );
$books = R::find( 'users', ' login=? and pass=? ', [$_POST['login'], $_POST['pass']] );
if(count($books)==1){
$id = $books[0]['id'];
echo 'logged';
} else {
echo 'error';
}