Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Extension ‘mysql_’ is deprecated (PHP 7)

$
0
0

Replies: 0

Hi,

I’ve scanned my site for potential PHP upgrade issues using the “PHP Compatibility Checker” plugin. I realize that it tends to throw false positives, but it might still be worth while checking up on the following:

Name: Participants Database

FILE: ---/wp-content/plugins/participants-database/classes/PDb_List_Query_Filter.class.php
--------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------
 249 | ERROR | Extension 'mysql_' is deprecated since PHP 5.5 and removed since PHP 7.0 - use mysqli instead.
--------------------------------------------------------------------------------------------------------------------------------

Here’s the code snippet (it looks like the deprecated call is a fallback):

  private static function _esc_like($term) {
    global $wpdb;
    if (method_exists($wpdb, 'esc_like')) {
      return $wpdb->esc_like($term);
     }
     return mysql_real_escape_string(addcslashes($term, "%_"));
  }

-mallard66


Viewing all articles
Browse latest Browse all 59525

Trending Articles