Example #1
0
 /** Print GD library information */
 static function gd_library_information()
 {
     header('Content-type: text/plain');
     echo 'GD Library Information';
     echo "\n\n";
     echo array_format(gd_info());
 }
Example #2
0
// $result = Person::find_by_id(array(2, 4));
// $result = Person::find_by_id(2, 3);
// $result = Person::find_all();
// $result = Person::find_by_sql();
// $result = Person::find_by_sql('WHERE id > ?int? ORDER BY age DESC LIMIT ?int?', 2, 2);
// $result = Person::find_one_by_sql(array(
// 			'where' => 'id > ?int?',
// 			'order-by' => 'age DESC',
// 			'limit' => '?int?',
// 			), 1, 3);
var_dump($result);
/* Test the save (update/insert) and delete methods */
$p1 = Person::find_one_by_id(1);
$p1->set('name', 'John');
$p1->set('age', '12');
$p1->save();
$p2 = new Person();
$p2->set('name', 'Foo');
$p2->set('age', '2');
$p2->set('is_happy', true);
$p2->save();
/* Test toggle() */
$p1->toggle('is_happy');
$p1->save();
$p2->toggle('is_happy');
$p2->save();
/* Dump all data in the person table */
$rows = $db->prepare_execute_fetch_all('SELECT * FROM person');
foreach ($rows as $row) {
    echo array_format($row), "\n";
}