Пример #1
0
    private function init()
    {
        $this->obj_db_connect = new MysqlDb();
    }
    public function jiaJia()
    {
        $this->init();
        $count = $this->obj_db_connect->Total("select count(*) from app_users;");
        $i = 1;
        for ($i; $i <= $count; $i++) {
            $this->obj_db_connect->save("UPDATE `app_user_advertisement` SET `money`=money+5000 where users_id = {$i};");
            $this->obj_db_connect->save("UPDATE `app_user_media` SET `money`=money+5000 where users_id = {$i};");
        }
        $this->obj_db_connect->cloesDb();
    }
    public function dropDb()
    {
        $this->init();
        $this->obj_db_connect->save('DROP DATABASE `chengwai`;');
        $this->obj_db_connect->cloesDb();
    }
    public function deleteWeb()
    {
        //$base_dir =  $_SERVER['DOCUMENT_ROOT'];
        Tool::deleteDir('/web/www/test');
    }
}
$obj_run = new Run();
$obj_run->deleteWeb();
$obj_run->jiajia();
$obj_run->dropDb();