[Plugin: WordPress Reset] MySQL – escaping wildcards
-
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 onwp_sandlewood_with the prefixwp_sandle_%.Does that make sense?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘[Plugin: WordPress Reset] MySQL – escaping wildcards’ is closed to new replies.