PHP code example of gingteam / redbean

1. Go to this page and download the library: Download gingteam/redbean 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/ */

    

gingteam / redbean example snippets


use GingTeam\RedBean\Facade as R;

R::setup('sqlite:'.__DIR__.'/data.db');

$book = model('book');
$book->author = 'Santa Claus';
$book->title = 'Secrets of Christmas';
R::store($book);

$qb = R::createQueryBuilder();

$data = $qb
    ->select('*')
    ->from('book')
    ->fetch();