Osclass forums

Support forums => General help => 3.7.x => Topic started by: Nirav_radia on December 30, 2016, 04:24:19 pm

Title: Solved:Unable to access admin part (oc-admin)
Post by: Nirav_radia on December 30, 2016, 04:24:19 pm
I am trying to access my admin panel but sometime it's not loading  :(

Error log :

[30-Dec-2016 17:07:48 Asia/Kolkata] PHP Fatal error:  Call to a member function numRows() on a non-object in /home/macularmetrics/public_html/oc-includes/osclass/model/Admin.php on line 63
[30-Dec-2016 17:21:25 Asia/Kolkata] PHP Fatal error:  Call to a member function numRows() on a non-object in /home/macularmetrics/public_html/oc-includes/osclass/model/Admin.php on line 63

or sometime its taking long time to load. 

PFA

Help really appreciated.


Thanks

Title: Re: Unable to access admin part (oc-admin)
Post by: Aficionado on December 30, 2016, 04:30:56 pm
Please search here before posting.

I hope this helps you out:

http://forums.osclass.org/general-help/fatal-error-call-to-a-member-function-numrows()-on-a-non-object-in-oc-includes/
Title: Re: Unable to access admin part (oc-admin)
Post by: _CONEJO on December 30, 2016, 05:14:14 pm
In oc-includes/osclass/model/Admin.php replace lines 61-67 from

Code: [Select]
            $return = $this->dao->query('SHOW COLUMNS FROM ' . $this->getTableName() . ' where Field = "b_moderator" ');

            if( $return->numRows() > 0 ) {
                $this->setFields( array('pk_i_id', 's_name', 's_username', 's_password', 's_email', 's_secret', 'b_moderator') );
            } else {
                $this->setFields( array('pk_i_id', 's_name', 's_username', 's_password', 's_email', 's_secret') );
            }

to

Code: [Select]
                $this->setFields( array('pk_i_id', 's_name', 's_username', 's_password', 's_email', 's_secret', 'b_moderator') );
Title: Re: Unable to access admin part (oc-admin)
Post by: Aficionado on December 30, 2016, 05:51:59 pm
Similar problems also from others using Godaddy hosting.

Title: Re: Unable to access admin part (oc-admin)
Post by: Nirav_radia on December 30, 2016, 07:02:03 pm
Thanks for your help . But probem is still there.

Code: [Select]
In oc-includes/osclass/model/Admin.php replace lines 61-67 from

Code: [Select]
            $return = $this->dao->query('SHOW COLUMNS FROM ' . $this->getTableName() . ' where Field = "b_moderator" ');

            if( $return->numRows() > 0 ) {
                $this->setFields( array('pk_i_id', 's_name', 's_username', 's_password', 's_email', 's_secret', 'b_moderator') );
            } else {
                $this->setFields( array('pk_i_id', 's_name', 's_username', 's_password', 's_email', 's_secret') );
            }

to

Code: [Select]
                $this->setFields( array('pk_i_id', 's_name', 's_username', 's_password', 's_email', 's_secret', 'b_moderator') );



I tried this but same problem.


I am able to login directly on listing page

http://********.com/oc-admin/index.php?page=items

So I think there is a problem in oc-admin dashboard & Osclass Market area.
Title: Re: Unable to access admin part (oc-admin)
Post by: Aficionado on December 30, 2016, 10:20:04 pm
I don't get it. Did you try MY suggestion:

http://forums.osclass.org/general-help/fatal-error-call-to-a-member-function-numrows()-on-a-non-object-in-oc-includes/