关于PHP Mysqli连接问题 5
目前的连接正常。$this->conn=newmysqli("localhost","root","123456","news");但是我想把mysqli连接字符串里的用...
目前的连接正常。$this->conn = new mysqli("localhost","root","123456","news");
但是我想把mysqli连接字符串里的用户名和密码等写成变量,按照下面的写,可是老报错,请问正确的应该是怎样写呢?
$local='localhost';
$mysqlid='root';
$mysqlpass='';
$mysqldata='wing';
$this->conn = new mysqli("$local","$mysqlid","$mysqlpass","$mysqldata"); 展开
但是我想把mysqli连接字符串里的用户名和密码等写成变量,按照下面的写,可是老报错,请问正确的应该是怎样写呢?
$local='localhost';
$mysqlid='root';
$mysqlpass='';
$mysqldata='wing';
$this->conn = new mysqli("$local","$mysqlid","$mysqlpass","$mysqldata"); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询