Beispiel #1
0
 /**
  * @param $table
  */
 function ExistTable($table)
 {
     $a = $this->Query($this->sql->ExistTable($table));
     if (!is_array($a)) {
         return false;
     }
     $b = current($a);
     if (!is_array($b)) {
         return false;
     }
     $c = (int) current($b);
     if ($c > 0) {
         return true;
     } else {
         return false;
     }
 }
Beispiel #2
0
} else {
    if ($action == "checkConnect") {
        include "include/dbsql.php";
        $dbsql = new DbSql();
        $db['host'] = get('db_address');
        $db['user'] = get('db_user');
        $db['password'] = get('db_pwd');
        $flag = $dbsql->checkConnect($db);
        if ($flag) {
            echo "success";
        } else {
            echo "fail";
        }
    } elseif ($action == 'installSql') {
        include "include/dbsql.php";
        $dbsql = new DbSql();
        $db['host'] = get('db_address');
        $db['user'] = get('db_user');
        $db['password'] = get('db_pwd');
        $db_name = get('db_name');
        $db_pre = get('db_pre');
        $admin_user = get("admin_user");
        $admin_pwd = get("admin_pwd");
        $admin_repwd = get("admin_repwd");
        if ($db['host'] != null && $db_name != null && $db['user'] != null && $admin_user != null && $admin_pwd != null && $admin_pwd == $admin_repwd) {
            //安装Sql
            $flag = $dbsql->checkConnect($db);
            if ($flag) {
                //apache_setenv('no-gzip', 1);
                @ini_set('zlib.output_compression', 0);
                @ini_set('implicit_flush', 1);