php Notice: Undefined variable:conne问题
index.php页面----------------------include_once'conn/conn.php';require(a.php);---------...
index.php页面
----------------------
include_once 'conn/conn.php';
require(a.php);
-------------------------
conn.php页面
----------------------
$conne = new opmysql();
class opmysql{
private $host = 'localhost';
private $name = 'root';
.......................
.................
function getRowsArray($sql){
...............................
}
}
---------------------
a.php页面方法(页面内调用)
---------------------
function drow($sql,$srow){
$i=0;
$j=0;
$rdinfo=$conne->getRowsArray($sql);//报错
foreach($rdinfo as $value){
..........................
}
$i++;
}
}
drow($sql,$srow);
---------------------------
报错
-------------------
Notice: Undefined variable: conne in D:\...........a.php;
Fatal error: Call to a member function getRowsArray() on a non-object in D:...........a.php;
-----------------
请问这错误怎样解决.......谢谢! 展开
----------------------
include_once 'conn/conn.php';
require(a.php);
-------------------------
conn.php页面
----------------------
$conne = new opmysql();
class opmysql{
private $host = 'localhost';
private $name = 'root';
.......................
.................
function getRowsArray($sql){
...............................
}
}
---------------------
a.php页面方法(页面内调用)
---------------------
function drow($sql,$srow){
$i=0;
$j=0;
$rdinfo=$conne->getRowsArray($sql);//报错
foreach($rdinfo as $value){
..........................
}
$i++;
}
}
drow($sql,$srow);
---------------------------
报错
-------------------
Notice: Undefined variable: conne in D:\...........a.php;
Fatal error: Call to a member function getRowsArray() on a non-object in D:...........a.php;
-----------------
请问这错误怎样解决.......谢谢! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询