mike_eddie
mike_eddie

Reputation: 73

Fatal error: Uncaught Error: Call to undefined function mysql_error()

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

Upvotes: 1

Views: 4719

Answers (3)

est271
est271

Reputation: 1

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 = [];

Upvotes: 0

Ejaz
Ejaz

Reputation: 241

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){

Upvotes: 5

Argus Duong
Argus Duong

Reputation: 2654

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.

Upvotes: 0

Related Questions