2015-10-25 28 views
1

這是我的錯誤信息致命錯誤:調用C:\ AppServ \ www \ hfix中非對象的成員函數FetchRow() \包括\ care_api_classes \ class_mini_dental.php上線749致命錯誤:調用非成員函數FetchRow()

while ($loly<$numdays){ 
     $income = 0; 
     $cost = 0; 
     $costs = 0; 

     $dt = $yrs . '-' . $mnth . '-' . $loly; 

     if ($cc=='0'){$cc='1';} else{$cc='0';} 

     $this->sql='SELECT `encounter_nr`,`article_item_number`,`dosage`,`price` FROM `care_encounter_prescription` WHERE `bill_status` = "archived" AND `prescribe_date` = "'.$dt.'" ORDER BY encounter_nr ASC '; 
     $this->result=$db->Execute($this->sql); 
     $this->sql='SELECT DISTINCT(`encounter_nr`) FROM `care_encounter_prescription` WHERE `bill_status` = "archived" AND `prescribe_date` = "'.$dt.'" ORDER BY encounter_nr ASC '; 
     $this->newquery=$db->Execute($this->sql); 
     $patients = $this->newquery->RecordCount(); 
     while($this->zrow = $this->result->FetchRow()){ 
       $this->sql = 'SELECT `unit_cost` FROM `care_tz_drugsandservices` WHERE `item_id` = '.$this->row[1]; 
       $this->lastquery=$db->Execute($this->sql); 
       if ($vx = $this->lastquery->FetchRow()) $cost = $vx[0]; 
       else $cost = 0; 

       $costs += $this->row[2] * $cost;   # dosage * cost 
       $income += $this->row[2] * $this->row[3]; # dosage * price 
     } 

回答

0

這個查詢:

$this->sql = 'SELECT `unit_cost` FROM `care_tz_drugsandservices` WHERE `item_id` = '.$this->row[1]; 

不返回任何行。您可以通過在phpMyAdmin中進行測試來確認。 FetchRow不能正常處理這些異常,因此在開始提取行之前,您需要測試查詢的結果。

+0

它返回一個錯誤錯誤:未知的標點符號字符串 –

相關問題