phpMyFAQ notice [8]: Trying to get property of non-object in

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Thorsten
Posts: 15744
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: phpMyFAQ notice [8]: Trying to get property of non-object in

Post by Thorsten »

Hi,

you can try this patch as well:

Code: Select all

univac:phpMyFAQ-2.6 thorsten$ git diff phpmyfaq/inc/PMF_Search/Database/Mysqli.php
diff --git a/phpmyfaq/inc/PMF_Search/Database/Mysqli.php b/phpmyfaq/inc/PMF_Search/Database/Mysqli.php
index cf0d7e6..283a5a1 100644
--- a/phpmyfaq/inc/PMF_Search/Database/Mysqli.php
+++ b/phpmyfaq/inc/PMF_Search/Database/Mysqli.php
@@ -81,7 +81,7 @@ class PMF_Search_Database_Mysqli extends PMF_Search_Database
             $this->resultSet = $this->dbHandle->query($query);
             
             // Fallback for searches with less than three characters
-            if (0 == $this->dbHandle->num_rows($this->resultSet)) {
+            if (false == $this->resultSet) {
                 
                 $query = sprintf("
                     SELECT
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
notset4life
Posts: 30
Joined: Tue Oct 18, 2005 2:02 pm

Re: phpMyFAQ notice [8]: Trying to get property of non-object in

Post by notset4life »

Yes I'm sure. The BOTTOM of that file looks like this:

Code: Select all

// Fallback for searches with less than three characters
             iif (is_object($this->resultSet) && 0 == $this->dbHandle->num_rows($this->resultSet)) {
                
                $query = sprintf("
                    SELECT
                        %s
                    FROM 
                        %s %s %s
                    WHERE
                        %s
                        %s",
                    $this->getResultColumns(),
                    $this->getTable(),
                    $this->getJoinedTable(),
                    $this->getJoinedColumns(),
                    $this->getMatchClause($searchTerm),
                    $this->getConditions());
            }
            
            $this->resultSet = $this->dbHandle->query($query);
        }
        
        return $this->resultSet;
    }
}
Just a blank page as you can see at
www.cybermidi.com/faq (when you click on any FAQ)
notset4life
Posts: 30
Joined: Tue Oct 18, 2005 2:02 pm

Re: phpMyFAQ notice [8]: Trying to get property of non-object in

Post by notset4life »

...and still a blank page on your previous post about trying "this is well"
Thorsten
Posts: 15744
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: phpMyFAQ notice [8]: Trying to get property of non-object in

Post by Thorsten »

Hi,

a white page is a PHP fatal error. Please take a look at your error log to see where this happens. It cannot be the change I posted here.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
notset4life
Posts: 30
Joined: Tue Oct 18, 2005 2:02 pm

Re: phpMyFAQ notice [8]: Trying to get property of non-object in

Post by notset4life »

nothing in my logs Thorsten. Guess it looks like I have a problem.
Thorsten
Posts: 15744
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: phpMyFAQ notice [8]: Trying to get property of non-object in

Post by Thorsten »

Hi,

okay, please revert both changes... in inc/PMF_DB/Mysqli.php and in inc/PMF_Search/Database/Mysqli.php

Then we start from the beginning.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
notset4life
Posts: 30
Joined: Tue Oct 18, 2005 2:02 pm

Re: phpMyFAQ notice [8]: Trying to get property of non-object in

Post by notset4life »

changes reverted. Thanks
Thorsten
Posts: 15744
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: phpMyFAQ notice [8]: Trying to get property of non-object in

Post by Thorsten »

Hi,

so now you have no blank page?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
notset4life
Posts: 30
Joined: Tue Oct 18, 2005 2:02 pm

Re: phpMyFAQ notice [8]: Trying to get property of non-object in

Post by notset4life »

no blank page, just the same results as posted before.
Thorsten
Posts: 15744
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: phpMyFAQ notice [8]: Trying to get property of non-object in

Post by Thorsten »

Hi,

okay, please try this again in the file inc/PMF_Search/Database/Mysqli.php, line 84:

Code: Select all

-            if (0 == $this->dbHandle->num_rows($this->resultSet)) {
+            if (false == $this->resultSet) {
Thanks for your patience! Bad, that I cannot reproduce this...

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
notset4life
Posts: 30
Joined: Tue Oct 18, 2005 2:02 pm

Re: phpMyFAQ notice [8]: Trying to get property of non-object in

Post by notset4life »

don;t worry...it's how you get better.

Unfortunately, no good...BLANK PAGE again.
Thorsten
Posts: 15744
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: phpMyFAQ notice [8]: Trying to get property of non-object in

Post by Thorsten »

Hi,

did you remove the + at the beginning of the line?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
notset4life
Posts: 30
Joined: Tue Oct 18, 2005 2:02 pm

Re: phpMyFAQ notice [8]: Trying to get property of non-object in

Post by notset4life »

Yes
Thorsten
Posts: 15744
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: phpMyFAQ notice [8]: Trying to get property of non-object in

Post by Thorsten »

Hi,

one short question: could you please change the database connection from "mysqli" to "mysql" in config/database.php?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
notset4life
Posts: 30
Joined: Tue Oct 18, 2005 2:02 pm

Re: phpMyFAQ notice [8]: Trying to get property of non-object in

Post by notset4life »

Hi Thorsten - changing it to mysql actually fixed the problem! It works now.

Any thoughts on what happened here?
Post Reply