我有兩個功能getCompanyDetails
和getHostingDetails
兩種不同的功能一個工作一個調用非對象
getCompanyDetails
正常工作的第一個數據庫,但getHostingDetails
顯示
Trying to get property of non-object
getCompanyDetails:
控制器:$data['companyName'] = $this->quote->getCompanyDetails()->companyName;
型號:
public function getCompanyDetails()
{
$this->db->select('companyName,companySlogan,companyContact,
companyEmail,companyWebsite,companyPhone,
companyFax,companyAddress');
$this->db->from('companyDetails');
$result = $this->db->get();
if($result->num_rows()<1)
{
return FALSE;
}else{
return $result->row();
}
}
getHostingDetails:
控制器:
$data['hostingRequired'] = $this->quote->getHostingDetails()->hostingRequired;
型號:
public function getHostingDetails()
{
$this->db->select('hostingRequired,domainRequired,domainToBeReged,
domaintoBeReged0,domainTransfer,domainToBeTransfered,
domainToBeTransfered0,currentHosting');
$this->db->from('hostingDetails');
$result = $this->db->get();
if($result->num_rows()<1)
{
return FALSE;
}else{
return $result->row();
}
}
:)我怎樣才能顯示錯誤信息?我有一個公平的想法,如果另一個聲明 – 2012-04-08 02:21:46