Title: Fatal error: Uncaught Error: Call to undefined function mysql_error
Last modified: August 31, 2016

---

# Fatal error: Uncaught Error: Call to undefined function mysql_error

 *  [Aponazz](https://wordpress.org/support/users/aponazz/)
 * (@aponazz)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/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.
    Thanks!

Viewing 11 replies - 1 through 11 (of 11 total)

 *  [LuzAr](https://wordpress.org/support/users/luzar/)
 * (@luzar)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-error-call-to-undefined-function-mysql_error/#post-7000962)
 * I have same issue after creating a backup using duplicator and restoring it on
   my local machine
 *  Thread Starter [Aponazz](https://wordpress.org/support/users/aponazz/)
 * (@aponazz)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-error-call-to-undefined-function-mysql_error/#post-7000975)
 * Hi! untill now I could not fix it. Some guy gave me this link with a possible
   solution, but do not worked for me.
 * Look: [http://stackoverflow.com/questions/8225198/phpmyadmin-the-mysql-extension-is-missing/8225474#8225474](http://stackoverflow.com/questions/8225198/phpmyadmin-the-mysql-extension-is-missing/8225474#8225474)
 * I hope it works for you!
 *  [andreasalptun](https://wordpress.org/support/users/andreasalptun/)
 * (@andreasalptun)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-error-call-to-undefined-function-mysql_error/#post-7001026)
 * 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](https://dev.mysql.com/doc/apis-php/en/apis-php-function.mysql-error.html)
 * It’s the revslider plugin that doesn’t conform to the latest API.
 * I am using one.com and was able to downgrade PHP to version 5.6 in the control
   panel.
 * Problem solved!
 *  Thread Starter [Aponazz](https://wordpress.org/support/users/aponazz/)
 * (@aponazz)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-error-call-to-undefined-function-mysql_error/#post-7001032)
 * 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!
 *  [oldcode](https://wordpress.org/support/users/coconutcoder/)
 * (@coconutcoder)
 * [10 years ago](https://wordpress.org/support/topic/fatal-error-uncaught-error-call-to-undefined-function-mysql_error/#post-7001069)
 * Downgrading from php 7 to a 5.x version as a fix? Hmmm…there must be a better
   way.
 *  [Stringman](https://wordpress.org/support/users/banjohead/)
 * (@banjohead)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-error-call-to-undefined-function-mysql_error/#post-7001071)
 * 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: [https://premium.wpmudev.org/forums/topic/revolution-slider-network-activate-failed](https://premium.wpmudev.org/forums/topic/revolution-slider-network-activate-failed)
 *  [phongcach](https://wordpress.org/support/users/phongcach/)
 * (@phongcach)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-error-call-to-undefined-function-mysql_error/#post-8353295)
 * mysql_error was removed from PHP7.0.0 so best way is change to mysqli_error
 *  [iannerney](https://wordpress.org/support/users/iannerney/)
 * (@iannerney)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-error-call-to-undefined-function-mysql_error/#post-8573456)
 * Here’s a quick fix that worked for me…
 * Change line 29 of db.class.php from:
    if(mysql_error()){
 * to:
 * if(mysqli_error()){
    -  This reply was modified 9 years, 5 months ago by [iannerney](https://wordpress.org/support/users/iannerney/).
 *  [gbengalex](https://wordpress.org/support/users/gbengalex/)
 * (@gbengalex)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-error-call-to-undefined-function-mysql_error/#post-8579487)
 * please where is db.class.php?
 *  [ccgauvin94](https://wordpress.org/support/users/ccgauvin94/)
 * (@ccgauvin94)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-error-call-to-undefined-function-mysql_error/#post-8624524)
 * If you’re still looking, it’s in /wp-content/plugins/revslider/inc_php/framework/
 *  [Almazka](https://wordpress.org/support/users/almazka/)
 * (@almazka)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-error-call-to-undefined-function-mysql_error/#post-8667705)
 * 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
 *     ```
       if(mysql_error()){
       	$query = $this->wpdb->last_query;
       	$message = $this->wpdb->last_error;
   
       	if($prefix) $message = $prefix.' - <b>'.$message.'</b>';
       	if($query) $message .=  '<br>---<br> Query: ' . $query;
   
       	$this->throwError($message);
       }
       ```
   
 * 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);
   
       		$this->throwError($message);
       	}
       }
       ```
   

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.

## Tags

 * [fatal error](https://wordpress.org/support/topic-tag/fatal-error/)
 * [MySQL](https://wordpress.org/support/topic-tag/mysql/)
 * [revslider](https://wordpress.org/support/topic-tag/revslider/)
 * [undefined function](https://wordpress.org/support/topic-tag/undefined-function/)

 * 11 replies
 * 10 participants
 * Last reply from: [Almazka](https://wordpress.org/support/users/almazka/)
 * Last activity: [9 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-error-call-to-undefined-function-mysql_error/#post-8667705)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
