我有以下配置。
private $host = '127.0.0.1';
private $db = 'loginexample';
private $dbusername = 'root';
private $dbpass = 'root';
$this->conn = new PDO("mysql:host={$host};dbname={$db};charset=utf8", $dbusername, $dbpass);
但如果我这样做
$this->conn = new PDO("mysql:host={$host};dbname=loginexample;charset=utf8", root, root);