Array Formation Issue

There a few things going on here. First, you’re getting back a multidimensional array (array of arrays) where the nested arrays have column names as keys. The reason for this is your use of the ARRAY_A parameter. You can read about the output types in the codex entry. You may be just fine using the … Read more

MySQL query for taxonomy-meta

Try select t.name, t.slug, tm.meta_key, tm.meta_value from wp_term_taxonomy AS tt inner join wp_terms AS t ON tt.term_id = t.term_id inner join wp_termmeta AS tm ON t.term_id = tm.term_id where tt.taxonomy = ‘census-tract’ order by t.name

Known Issues in WordPress When Upgrading PHP to ver 7

WordPress recommends PHP7 and MariaDB 10.0 or higher, so your core installation should be fine. If you’re using any third-party plugins and/or themes (including ones you’ve written), you would be wise to ensure that they too are compatible with PHP7. Check the respective maintainers’ support streams (either the relevant plugin/theme pages on wordpress.org or the … Read more

How can I detect right db type?

wpdb->dbh is declared as protected property, you should not even have access to it, unless you are subclassing wpdb? The only public property is wpdb->is_mysql which is just hardcoded for true and meant for detection of non–native database drop–ins. So overall wpdb context is meant to be internal, you set up the connection and let … Read more

How do I prepare strings for insertions as values into a MySQL table?

dbDelta is really meant for creating databases or tables, not inserting records. I’d suggest using $wpdb->insert(), which will escape the values for you: $wpdb->insert( $wpdb->prefix . ‘w2bw2c_venue’, array( ‘market_id’ => 7, ‘venue_name’ => get_the_title( $id ), ), array( ‘%d’, ‘%s’, ) ); I’ve just used the name field you were having trouble with in my … Read more