WordPress Reset
[resolved] MySQL - escaping wildcards (2 posts)

  1. GRAQ
    Posted 3 years ago #


    My question is regarding this code:

    global $wpdb;
                            $tables = $wpdb->get_col("SHOW TABLES LIKE '{$wpdb->prefix}%'");
                            foreach ($tables as $table) {
                                    $wpdb->query("DROP TABLE $table");

    Based around the fact that '_' is a single character mysql wildcard (http://dev.mysql.com/doc/refman/5.0/en/string-comparison-functions.html#operator_like)

    I have multiple (non network) installations, each with a unique table prefix. Usually using the format wp_mysite_ wp_anothersite_. Do you know if the wpdb class is escaping that or can I get an upsetting hit on wp_sandlewood_ with the prefix wp_sandle_%.

    Does that make sense?


  2. Matt Martz
    Plugin Author

    Posted 3 years ago #

    Fixed in 1.3.1

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WordPress Reset
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic