Example #1
0
$error = db_connect();
if ($error == 2) {
    $flow = 0;
    $path = "error/e404/s";
}
// 404
if ($error == 3) {
    $flow = 0;
    $path = "setup/database";
}
// mysql settings wrong
//----------------------------------------------------------------
// 3) Check setup variable
//----------------------------------------------------------------
if ($flow) {
    $row = db_query_row("SELECT * FROM is_setup");
    if (!$row['yes']) {
        $flow = 0;
        $path = "setup/tables";
    }
}
//----------------------------------------------------------------
// 4) User implementation
//----------------------------------------------------------------
include_once "modules/user/user.php";
$module = new user();
$module->handler();
$userbox = $module->userbox();
//----------------------------------------------------------------
// 5) Load module acording too path argument
//----------------------------------------------------------------
Example #2
0
 function get_view($id)
 {
     return db_query_row($this, "SELECT * FROM items WHERE id='" . $id . "'");
 }