src/Mysqli.php
public function openMysql($dbConfig = array())
    {
        try {
            $res = mysqli_connect($dbConfig['db_host'], $dbConfig['db_user'], $dbConfig['db_pwd'], $dbConfig['db_name']);

            mysqli_query($res, 'set names utf8mb4');
            mysqli_query($res, 'SET sql_mode =\'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION\'');

        } catch (Exception $e) {
            throw new Exception($e->getMessage());
        }

        if (!$res) {
            throw new Exception('连接数据库失败，可能数据库密码不对或数据库服务器出错！');
        }

        return $res;
    }
public function openMysql($dbConfig = array())
    {
        try {
            $res = mysqli_connect($dbConfig['db_host'], $dbConfig['db_user'], $dbConfig['db_pwd'], $dbConfig['db_name']);

            mysqli_query($res, 'set names utf8mb4');
            mysqli_query($res, 'SET sql_mode =\'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION\'');

        } catch (Exception $e) {
            throw new Exception($e->getMessage());
        }

        if (!$res) {
            throw new Exception('连接数据库失败，可能数据库密码不对或数据库服务器出错！');
        }

        return $res;
    }
连接数据库
@date   2017-03-19T16:18:28+0800
@author ChenMingjiang