geminilabs

[site-reviews] test db table structure

Oct 23rd, 2020 (edited)
951
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * This gets the database table structure for some of the tables
  3.  * to see if they share the same structure. If they don't, then
  4.  * this could be why the table constraints are throwing errors
  5.  */
  6. add_action('init', function() {
  7.     global $wpdb;
  8.     $dbTableStructure = $wpdb->get_results("
  9.        SELECT TABLE_NAME, TABLE_COLLATION, ENGINE
  10.        FROM information_schema.TABLES
  11.        WHERE TABLE_SCHEMA = '{$wpdb->dbname}' AND TABLE_NAME IN ('{$wpdb->posts}', '{$wpdb->users}', '{$wpdb->terms}', '{$wpdb->prefix}glsr_ratings', '{$wpdb->prefix}glsr_assigned_posts', '{$wpdb->prefix}glsr_assigned_terms', '{$wpdb->prefix}glsr_assigned_users')
  12.    ");
  13.     glsr_log($dbTableStructure);
  14. });
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×