Fatal error: Call to a member function getValue() on a non-object in D:\wamp\www\15\common\apps\Borough.class.php on line 253找到253行如下:function getInfo($id,$field = '*',$more_info = 0,$merge=false) {
$borough = $this->db->getValue('select '.$field .' from '.$this->tName.' where id='.$id); // 253行
if($more_info){
$boroughInfo = $this->db->getValue('select * from '.$this->tNameInfo.' where id='.$id);
if($merge){
return array_merge((array)$borough,(array)$boroughInfo);
}else{
return array('borough'=>$borough,'boroughInfo'=>$boroughInfo);
}
}else{
return $borough;
}
$borough = $this->db->getValue('select '.$field .' from '.$this->tName.' where id='.$id); // 253行
if($more_info){
$boroughInfo = $this->db->getValue('select * from '.$this->tNameInfo.' where id='.$id);
if($merge){
return array_merge((array)$borough,(array)$boroughInfo);
}else{
return array('borough'=>$borough,'boroughInfo'=>$boroughInfo);
}
}else{
return $borough;
}
解决方案 »
- 求助php高手 no database selected
- PHP5.0 和mysql5.0 和apache2.0 的配置方法和安装文件?急啊。。帮个忙啦。。。。。。。。。。
- 简单的PHP正则!
- 怎样实现批量动态页面的静态化?
- 系统中安装了oralce,启动APACHE时出错,帮忙啊, the requested operation has failed,怎么解决
- 看了一天SVG,累死人,散分,顺便问个问题
- MYSQL输出显示是乱码,而在数据库中却正常显示!高手指教~
- 开发团队,欲求JSP、ASP、PHP以及JAVA项目!
- 请问怎么样用javascript来跳转页面???
- 100分相送---网上购物的思路----
- PHP上传只能上传文本格式
- 计算出两个文件的相对路径
$this->db->getValue 这个有问题 改成 $this->getValue 试下
还是$this->db->getValue 这样呢
$this->db 出现在等号左边的行帖出周边代码
public function Borough( $db )
{
$this->db = $db;
}public function deleteexpert( $ids )
{
if ( is_array( $ids ) )
{
$ids = implode( ",", $ids );
$where = "id in (".$ids.")";
}
else
{
$where = "id=".intval( $ids );
}
return $this->db->execute( "delete from ".$this->tNameAdviser." where ".$where );
} public function getExpertInfo( $id )
{
return $this->db->getValue( "select * from ".$this->tNameAdviser." where id = ".$id );
} public function getLastEvaluateLog( $borough_id )
{
return $this->db->getValue( "select * from ".$this->tNameEvaluate." where borough_id = ".$borough_id." order by add_time desc" );
} public function saveEvaluteLog( $dataField )
{
$data = $this->db->getValue( "select * from ".$this->tNameEvaluate." where borough_id = ".$dataField['borough_id']." and add_time = ".$dataField['add_time'] );
if ( $data )
{
$fileddata = array(
"borough_evaluate" => $dataField['borough_evaluate'],
"creater" => $dataField['creater']
);
$this->db->update( $this->tNameEvaluate, $fileddata, "id = ".$data['id'] );
return TRUE;
}
$fileddata = array(
"borough_id" => $dataField['borough_id'],
"borough_evaluate" => $dataField['borough_evaluate'],
"creater" => $dataField['creater'],
"add_time" => $dataField['add_time']
);
$this->db->insert( $this->tNameEvaluate, $fileddata );
return TRUE;
}
public function Borough( $db )
{
printr(debug_backtrace());
$this->db = $db;
}帖出输出结果
老大如果改成你这样的
Fatal error: Call to undefined function printr() in D:\wamp\www\15\common\apps\Borough.class.php on line 27如果改成 print(debug_backtrace()); 页面头部多出一个 Array 字样
print_r(debug_backtrace());