1

I have built a website with wordpress which has recently stopped working. I am unable to login using he Wp-Admin page. When I login I get the following error, listed in the code below.

I wondered whether it might have been the rev slider causing problems. I have updated the base class admin.php file to change private static $arrMetaBoxes = ''; to private static $arrMetaBoxes = array();. This unfortunately has not worked.

Fatal error: Uncaught Error: Call to undefined function mysql_error() in /home3/epicccon/public_html/sophia/wp-content/plugins/revslider/inc_php/framework/db.class.php:29 Stack trace: #0 /home3/epicccon/public_html/sophia/wp-content/plugins/revslider/inc_php/framework/db.class.php(127): UniteDBRev->checkForErrors('fetch') #1 /home3/epicccon/public_html/sophia/wp-content/plugins/revslider/inc_php/revslider_params.class.php(42): UniteDBRev->fetch('wp_xiht_revslid...') #2 /home3/epicccon/public_html/sophia/wp-content/plugins/revslider/inc_php/revslider_operations.class.php(1072): RevSliderParams->getFieldFromDB('general') #3 /home3/epicccon/public_html/sophia/wp-content/plugins/revslider/revslider_front.php(30): RevOperations::getGeneralSettingsValues() #4 /home3/epicccon/public_html/sophia/wp-includes/plugin.php(525): RevSliderFront->onAddScripts('') #5 /home3/epicccon/public_html/sophia/wp-includes/script-loader.php(1049): do_action('wp_enqueue_scri...') #6 /home3/epicccon/public_html/sophia/wp-includes/plugin.php(525): wp in /home3/epicccon/public_html/sophia/wp-content/plugins/revslider/inc_php/framework/db.class.php on line 29

Warning: Parameter 1 to W3_Plugin_TotalCache::ob_callback() expected to be a reference, value given in /home3/epicccon/public_html/sophia/wp-includes/functions.php on line 3570
1
  • try deactivate w3 total cache plugin (rename the folder using ftp) and try changing into default theme Commented Apr 23, 2019 at 9:48

3 Answers 3

5

You will need to update the source code of revolution slider plugin. Edit wp-content/plugins/revslider/inc_php/framework/db.class.php Find checkForErrors function and replace below piece of code

if(mysql_error()){

with

if($this->wpdb->last_error){
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, although that fixes the one line an additional change is also required in base_admin.class.php. Line 23 needs replacing with private static $arrMetaBoxes = array();
0

There is no other reason that PHP 7.0+ stopped support mysql_* function, including mysql_connect(), mysql_error(),... Maybe your hosting provider upgrading to PHP 7.x without your attention.

Please consider upgrade your code base to the newest version: WordPress, themes, plugins. Another bad option is downgrade to PHP 5.x as previous.

Ask your hosting provider for their advise.

Comments

0

As mentioned in the answer by Ejaz, editing the line of code in wp-content/plugins/revslider/inc_php/framework/db.class.php should work.

another solution is to try the suggestion in the php documentation and replacing that same line of code:

if(mysql_error()){

with the code:

if($mysqli -> error){

see php mysql_error

also don't forget to change the line of code in base_admin.class.php

private static $arrMetaBoxes = '';

to

private static $arrMetaBoxes = [];

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.