abstract:$type = 'mysql';//数据库类型$host = '127.0.0.1';//数据库地址$dbname = 'test';//数据库名$charset = 'utf8';//默认编码$dsn = $type.':host='.$host.';dbname='.$dbname.';ch
$type = 'mysql';//数据库类型
$host = '127.0.0.1';//数据库地址
$dbname = 'test';//数据库名
$charset = 'utf8';//默认编码
$dsn = $type.':host='.$host.';dbname='.$dbname.';charset';
$user = 'root';
$pass ='root';
$pdo =new PDO($dsn,$user,$pass);
var_dump($pdo);
Correcting teacher:韦小宝Correction time:2019-01-15 09:01:01
Teacher's summary:写的很不错 没有什么大毛病 不过有点太简洁了 pdo对数据库的操作课后要记得多练习才行哦