比如我的a.php的内容为:
<?php
$DbServer = '192.168.1.106:1265';
$User = 'wx';
$Password = 'wx123456';
?>
然后在我的b.php里面有一个方法为:
function CreateConn()
{
$con = mysql_connect($DbServer, $User, $Password);
if (!$con)
die('Could not connect: ' . mysql_error());
mysql_select_db("wenxibiz_wxstock", $con);
return $con;
}
会报错说:
Notice: Undefined variable: DbServer in C:\xampp\htdocs\wx\Utilities\GenConn.php on line 6
Notice: Undefined variable: User in C:\xampp\htdocs\wx\Utilities\GenConn.php on line 6
Notice: Undefined variable: Password in C:\xampp\htdocs\wx\Utilities\GenConn.php on line 6
请问这个是怎么回事,该如何解决呢?
守候你守候我