从别处移植一个网站,整体报这样的错误
错误一:
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;
}
错误一:
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;
}
解决方案 »
- php站点中页面有乱码Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: text
- php怎么获得asp.net的session值?在线等...
- 跪求好人帮忙搭建php开发环境!
- 发言内容就是传不到数据库里
- 项目外包:急寻PHP高手,两个网站程序开发的项目,万元以上
- XOOPS中的smarty表单显示问题
- mysql中进行left join查询的时候是否可以多次left join 同一个表?
- PHP错误提示信息没有了.
- 请问如何获取目录的大小?
- 关于组合查询!
- xp+PHP+SQL2000连不上数据库???
- php 刷新页面
{
$sql.= ' AND `ID`='.$Station->ID;//737行
} 这个类有没有 new ,页面头部有没有调用 ? 路径对不对?
{
$sql.= ' AND `ID`='.$Station->ID;//737行 }
原来是ftp上传问题。
最后使用二进制传输解决了,默认是ascii码传输。
一般的 ftp 是 二进制上传的
这个是没有问题的,你把 $Station 类的相关信息贴出来,最好 是把出错 的那个代码贴全点 ..
{
return $this->$ID;
}
//调用的时候改成
if ( !empty( $Station->id() ) )
{
$sql.= ' AND `ID`='.$Station->id();//737行
}
$string = (string)$value;
} else {
$string = 'Object';
}?> 这是我在Google里搜的,说得是php5.2版本后的会出现这种错误,但是我是修改我的appserv的版本呢,还是修改我的zend studio的版本,我是想不装zend studio,只装appserv在其他人的机器上运行
public function id()
{
return $this->ID; //是这样子的吧
/*
.
.
.
*/
}