主题:这个错误什么意思啊??
我对类\函数不太懂,请各位兄弟姐妹们帮帮忙,不慎感激啊!
错误提示:
Fatal error: Call to a member function on a non-object in d:\usr\www\html\shop\cart1.inc on line 71
代码是这样的:71行>> $this->Update();
函数内容:function Update()
{
global $sId,$sName,$sPrice,$sCount,$sMaxCount;
if(!isset($sId) or !isset($sName) or !isset($sPrice) or !isset($sMaxCount) or !isset($sCount)) return;
$this->Id =$sId;
$this->Name =$sName;
$this->Price =$sPrice;
$this->Count =$sCount;
$this->MaxCount = $sMaxCount ;
//计算商品总数
$this->SortCount=count($sId);
}
错误提示:
Fatal error: Call to a member function on a non-object in d:\usr\www\html\shop\cart1.inc on line 71
代码是这样的:71行>> $this->Update();
函数内容:function Update()
{
global $sId,$sName,$sPrice,$sCount,$sMaxCount;
if(!isset($sId) or !isset($sName) or !isset($sPrice) or !isset($sMaxCount) or !isset($sCount)) return;
$this->Id =$sId;
$this->Name =$sName;
$this->Price =$sPrice;
$this->Count =$sCount;
$this->MaxCount = $sMaxCount ;
//计算商品总数
$this->SortCount=count($sId);
}