Fatal error: Call to a member function FetchRow() on a non-object

前端 未结 1 684
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-28 16:56

This is my error message Fatal error: Call to a member function FetchRow() on a non-object in C:\\AppServ\\www\\hfix\\include\\care_api_classes\\class_mi

相关标签:
1条回答
  • 2021-01-28 17:20

    Assuming line 749 of the file C:\AppServ\www\hfix\include\care_api_classes\class_mini_dental.php is referring to this line in your example...

        if($this->row=$this->result->FetchRow()){
    

    Then your problem is that $this->result is not an object. You assign $this->result on the previous line with the return value of $db->Execute($this->sql). So if $db->Execute() returns anything other than object you would get that error. My guess is $db->Execute() failed to execute your query for one reason or another and return a boolean false or some other non-object value as indication of failure. You should check the return value for errors first before blindly using it like this.

    Also see https://stackoverflow.com/a/12769983/1878262 [related]

    0 讨论(0)
提交回复
热议问题