Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

31 lines (18 sloc) 0.595 kB
<?php
//Example Script, saves Hello World to the database.
//First, we need to include redbean
require_once('rb.php');
//Second, we need to setup the database
//If you work on Mac OSX or Linux (or another UNIX like system)
//You can simply use this line:
R::setup(); //This creates an SQLite database in /tmp
//R::setup('database.txt'); -- for other systems
//Ready. Now insert a bean!
$bean = R::dispense('leaflet');
$bean->title = 'Hello World';
//Store the bean
$id = R::store($bean);
//Reload the bean
$leaflet = R::load('leaflet',$id);
//Display the title
echo $leaflet->title;
Jump to Line
Something went wrong with that request. Please try again.