<?php
require "rb/db.php";
$test = R::findOne('users', "login = ?", $array = array($_SESSION['logged_user']->login));
$books = $test->books;
$book = explode(",", $books);
$numOfBooks = R::count( 'books' );
$kol = count($book);
$i = 0;
while(i < $kol){
$rand = rand(1, $numOfBooks);
echo $rand;
if($book[i] != $rand){
$con = R::findOne('users', "login = ?", $array = array($_SESSION['logged_user']->login));
$con->books+=$rand;
R::store( $con );
}
$i++;
}
?>
<?php if( isset($_SESSION['logged_user']) ) : ?>
Привет: <?php echo $_SESSION['logged_user']->login; ?>
Выйти
<?php else : ?>
АвторизацияРегистрация
<?php endif; ?>
<?php if( isset($_SESSION['logged_user']) ){
}
?>