Solution to “Call to undefined function mysql_error()” in RevSlider WordPress Plugin
February 12, 2021

Recently I was working on a website that has old RevSlider from 2014! It never got updated and the previous developers never cared to check or update the theme or the slider plugin.

Since WordPress is migrating to jQuery 3.x, I went to check into the site to make sure none of the plugins are dependent on jQuery and if they are, I need to add some fixes if the plugin devs don’t do anything.

Well, it turned out that none of the plugins were updated and it was running on old WordPress from 2014!

The people who developed the website couldn’t breathe without RevSlider plugin and I had to update everything. They bought the theme and the plugin came with it so they didn’t have a clue on what was going on. So, as soon as I updated the WordPress, the whole site broke into pieces!

So, I am going to add a quick fix that worked for me but first let’s see what the error looked like.

The error starts with “Fatal error: Uncaught Error: Call to undefined function mysql_error()”

My error was pointing to couple of files in the slider plugin directory.

The first error was base_admin.class.php which is located at wp-content/plugins/revslider/inc_php/framework/base_admin.class.php

The variable $arrMetaBoxes was defined as a string and I changed that variable to an array. your error should mention the line number as well.

$arrMetaBoxes = ""; // remove this

$arrMetaBoxes = array(); // add this 

The second error was pointing db.class.php which is located at wp-content/plugins/revslider/inc_php/framework/db.class.php

The function RevSlider is calling was deprecated in PHP 5.5.0, and it was removed in PHP 7.0.0. Instead, the MySQLi or PDO_MySQL extension should be used.

On PHP official site, there is a mention of this error.

Here is the fix:

if(mysql_error()){ // remove this

if($this->wpdb->last_error){ // add this

Both of the errors mention the line number and variable so that it makes our job a bit easier (not a whole lot though).


Leave a Reply

Most Read

#1 How to check if radio button is checked or not using JavaScript? #2 How to set opacity or transparency using CSS? #3 Pagination in CSS with multiple examples #4 How to make HTML form interactive and using CSS? #5 Solution to “TypeError: ‘x’ is not iterable” in Angular 9 #6 How to uninstall Cocoapods from the Mac OS?

Recently Posted

Mar 3 How to embed YouTube or other video links in WordPress? Mar 3 How to change the Login Logo in WordPress? Mar 3 substring() Method in JavaScript Mar 3 Window setInterval() Method in JavaScript Mar 2 How to zoom an element on hover using CSS? Mar 2 the box-sizing property in CSS

You might also like these

WHERE Clause in PostgresPostgresHow to check if a link has http or https in it in JavaScript?JavaScriptHow JavaScript classes allows us to do less typing (syntactic sugar)?JavaScriptFlash of Invisible Text and Mitt Romney Web Font ProblemCSSThe difference between 400(4xx) and 500(5xx) errorsMiscHow to create a link tag button using CSS?CSS