RedbeanPhp – Cheat sheet

Join

$sql = 'SELECT * FROM items
        JOIN files ON files.id = items.files_id WHERE approved is NOT NULL';
        $rows = R::getAll($sql);

Find all

$items = R::find('items', 'approved is NOT NULL');

FindLike

$obj = [
   'accounts_id' => Account_v0::$loggedIN['id'],
   'content_id' => $_REQUEST['content_id'],
   'content_types_id' => $_REQUEST['content_types_id'],
];
$ratings = R::findLike('ratings', $obj);

Leave a Reply

Your email address will not be published.