WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. GRAQ
    Member
    Posted 2 years ago #

    Hi!

    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?

    http://wordpress.org/extend/plugins/wordpress-reset/

  2. Matt Martz
    Member
    Plugin Author

    Posted 2 years ago #

    Fixed in 1.3.1

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic