从别处移植一个网站,整体报这样的错误
从别处移植一个网站,整体报这样的错误
错误一:
Object of class Station could not be converted to string in C:\AppServ\www\lfcha\Module\DAL\DAL_Goods.php on line 737
错误二:
Catchable fatal error: Object of class __PHP_Incomplete_Class could not be converted to string in C:\AppServ\www\lfcha\Module\DAL\DAL_Consume.php on line 229
基本上都是数据层里的错误,在Google上查说是要下载补丁,但我没找到补丁。
把错误一那行代码页贴出来吧
/**
* 读取站点
*
* @param Station $Station
* @return Station
*/
function GetStation(Station $Station)
{
$sql='Select * from `Station` where 1';
if ($Station->ID!='')
{
$sql.= ' AND `ID`='.$Station->ID;//737行 }
if ($Station->Principal->WebID!='')
{
$sql.= ' AND `Principal`=\''.$Station->Principal->WebID.'\';';
}
$result=mysql_query($sql,ConnMain);
if(mysql_errno(ConnMain))
{
throw new Exception('读取站点失败!');
}
$row=mysql_fetch_array($result);
$NewStation=new Station();
$NewStation->ID=$row['ID'];
$NewStation->Title=$row['Title'];
$NewStation->Principal->WebID=$row['Principal'];
$NewStation->Tel=$row['Tel'];
$NewStation->Address=$row['Address'];
return $NewStation;
}