address alternate table prefixes

Use $wpdb better to handle alternate table prefixes