Esempio n. 1
0
function db_init()
{
    global $DB_FIRST_ADMIN_ONLY;
    if ($DB_FIRST_ADMIN_ONLY !== TRUE) {
        return TRUE;
    }
    try {
        db_connect();
        db_create_user_table();
        return TRUE;
    } catch (PDOException $e) {
        //echo 'PDO ERROR: '.$e->getMessage()."\n";
        return FALSE;
    }
}
Esempio n. 2
0
function generate_tables()
{
    global $DB_FIRST_ADMIN_ONLY;
    if ($DB_FIRST_ADMIN_ONLY == FALSE) {
        return TRUE;
    }
    try {
        db_connect();
        db_create_user_table();
        db_create_generatedbooks_table();
        return TRUE;
    } catch (PDOException $e) {
        return FALSE;
    }
    db_close();
}