模式¶
MySQL数据库模型类
属性 | 值 |
---|---|
命名空间 | fize\db\realization\mysql |
类名 | Mode |
实现接口 | fize\db\definition\Mode |
方法: |
---|
方法名 | 说明 |
---|---|
mysqli() | mysqli方式构造 |
odbc() | odbc方式构造 |
pdo() | Pdo方式构造 |
getInstance() | 数据库实例 |
方法¶
mysqli()¶
mysqli方式构造
public static function mysqli (
string $host,
string $user,
string $pwd,
string $dbname,
mixed $port = "",
string $charset = "utf8",
array $opts = [],
bool $real = true,
string $socket = null,
array $ssl_set = [],
int $flags = null
) : \fize\db\realization\mysql\mode\Mysqli
参数: |
|
---|
odbc()¶
odbc方式构造
public static function odbc (
string $host,
string $user,
string $pwd,
string $dbname,
mixed $port = "",
string $charset = "utf8",
string $driver = null
) : \fize\db\realization\mysql\mode\Odbc
参数: |
|
---|
pdo()¶
Pdo方式构造
public static function pdo (
string $host,
string $user,
string $pwd,
string $dbname,
int $port = null,
string $charset = "utf8",
array $opts = [],
string $socket = null
) : \fize\db\realization\mysql\mode\Pdo
参数: |
|
---|
强烈推荐使用
getInstance()¶
数据库实例
public static function getInstance (
string $mode,
array $config
) : \fize\db\realization\mysql\Db
参数: |
|
---|