Support » Plugins » Fatal error: Uncaught Error: Call to undefined function mysql_error

  • Hi. I have a problem with a plugin. When I install it, pulls this error:

    Fatal error: Uncaught Error: Call to undefined function mysql_error() in /Applications/MAMP/htdocs/wordpress/wp-content/plugins/revslider/inc_php/framework/db.class.php:29 Stack trace: #0 /Applications/MAMP/htdocs/wordpress/wp-content/plugins/revslider/inc_php/framework/db.class.php(127): UniteDBRev->checkForErrors(‘fetch’) #1 /Applications/MAMP/htdocs/wordpress/wp-content/plugins/revslider/inc_php/revslider_params.class.php(42): UniteDBRev->fetch(‘wp_crear_revsli…’) #2 /Applications/MAMP/htdocs/wordpress/wp-content/plugins/revslider/inc_php/revslider_operations.class.php(1275): RevSliderParams->getFieldFromDB(‘general’) #3 /Applications/MAMP/htdocs/wordpress/wp-content/plugins/revslider/settings/general_settings.php(52): RevOperations::getGeneralSettingsValues() #4 /Applications/MAMP/htdocs/wordpress/wp-content/plugins/revslider/inc_php/framework/base_admin.class.php(346): require(‘/Applications/M…’) #5 /Applications/MAMP/htdocs/wordpress/wp-content/plugins/revslider/revslider_admin.php(58): UniteBaseAdminClassRev::r in /Applications/MAMP/htdocs/wordpress/wp-content/plugins/revslider/inc_php/framework/db.class.php on line 29

    What can I do? I´m new in this. The plugins come with the theme OMNI.

Viewing 11 replies - 1 through 11 (of 11 total)
  • I have same issue after creating a backup using duplicator and restoring it on my local machine

    Hi! untill now I could not fix it. Some guy gave me this link with a possible solution, but do not worked for me.


    I hope it works for you!

    Hi Guys!

    I had the same problem. According to the mysql specs the function mysql_error was deprecated in PHP 5.5 and removed in PHP 7.0.

    See: mysql_error

    It’s the revslider plugin that doesn’t conform to the latest API.

    I am using and was able to downgrade PHP to version 5.6 in the control panel.

    Problem solved!

    Hi! thanks for the answer.
    So, if I use the version 5.6 of PHP, this should work.

    I will try and I will tell you what happened.

    Thanks you!

    Downgrading from php 7 to a 5.x version as a fix? Hmmm…there must be a better way.

    My understanding is that updating to the latest version of the Slider Revolution plugin corrects the incompatibility with PHP 7. I haven’t tried it yet, but will let report back on what I find out after testing it. Another possible solution is to alter the plugin code so that it checks whether the function exists before calling it, as described here:

    mysql_error was removed from PHP7.0.0 so best way is change to mysqli_error

    Here’s a quick fix that worked for me…

    Change line 29 of db.class.php from:



    • This reply was modified 3 years, 9 months ago by iannerney.

    please where is db.class.php?

    If you’re still looking, it’s in /wp-content/plugins/revslider/inc_php/framework/

    To solve above error, please open file revslider/inc_php/framework/db.class.php and go to line no 29.

    You need to replace this code

    	$query = $this->wpdb->last_query;
    	$message = $this->wpdb->last_error;
    	if($prefix) $message = $prefix.' - <b>'.$message.'</b>';
    	if($query) $message .=  '<br>---<br> Query: ' . $query;

    with this one

    private function checkForErrors($prefix = ""){
    	global $wpdb;
    	if($wpdb->last_error !== ''){
    		$query = $wpdb->last_query;
    		$message = $wpdb->last_error;
    		if($prefix) $message = $prefix.' - <b>'.$message.'</b>';
    		if($query) $message .=  '<br>---<br> Query: ' . esc_attr($query);
Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Fatal error: Uncaught Error: Call to undefined function mysql_error’ is closed to new replies.