dbDelta
is extremely picky. Looking at your code I’d say you’ve violated this rule:
You must put each field on its own line in your SQL statement
Two of your fields are sharing lines with parenthesis. I haven’t tested that particular pattern but dbDelta
is extremely picky.
I don’t know if that space after NOT NULL
will matter.
I doubt that checking for the existence of the table is necessary. Checking your option should be sufficient.
And finally, register_activation_hook
is for plugins, not themes. There is no similar specialized theme activation hook that I am aware of. There are a number of work-arounds that have been suggested if you search this site for them.
Related Posts:
- Display Tables in a slider
- Why majority of fileds in wp_posts table prefixed with post_?
- How to insert more than one row of data into a table at one time
- Tablepress won’t update the table data [closed]
- WP_List_Table error on WordPress 4.4
- Bulk actions redirects to “options.php” page when clicked (WP_List_Table)
- putting wp_query data into html table
- Looking for a simple tool to update a table
- Table editing in WordPress
- How can I add a row in a table from a Linux Shell?
- WordPress admin Tables use to display own data – In admin WP
- Creating a Restaurant Menu
- How to populate custom tables with rows of data
- How to build a dynamic data table with backend fields for the user
- How to add custom field to wp_list_table
- database select issue
- get table prefixes for SUB-SITES?
- WordPress Table didn’t look right
- CSS for Table Rows and Columns
- How can I create this type of table/catalog? [closed]
- table chaos since upgrade to 4.8
- echo spesific title get_the_title
- What is the use of to_ping and pinged column?
- Removing filter dropdown in posts table (in this case Yoast SEO)
- Has parent field in the table wp_term_taxonomy has term_id or term_taxonomy_id
- How do you display posts in a dynamic table?
- Create a formatted table-like menu
- How To Make Connection To WordPress Data Base In A Plugin?
- Are custom post types suitable for storing high numbers of data elements, in this case chat messages?
- Include custom table into search results
- Save custom post type in different table
- Visual Editor freezing on text highlight since 4.3
- Should I global $wpdb outside of any of my plugin’s functions scope?
- Database with mixed collation (utf8mb4 & utf8_general_ci)
- Return number of items in a table with post id
- How can I add data to a custom column in the Users section of the wordpress backend?
- Why my database table not created on activation?
- How to update an existing table while updating plugin?
- Jquery not showing in homepage
- Accessing data from a non-WP database/table within a page content
- How to add a sortable date column in an admin page?
- WooCommerce/WordPress: how hide entire table form after submit (Admin Dashboard)?
- Filter table with dropdown
- input data and output table [closed]
- User Meta Data in a Sortable Table
- How do I get create a custom table showing the hours remaining for all customers in one page from this transactions page?
- WordPress plugin output formatting
- Retrieve data from the database to table such as comments in the admin control panel
- Modification of how the data is controlled/showed and stored
- Pull data and display as rows and columns
- Obtaining user table for one site on multisite set up
- Gutenberg table block with Bootstrap .table class
- dbDelta not installing database
- Is it a good idea to add a column to the posts table?
- display menu as table layout
- Is there alternative to WP_List_Table?
- Create new database through static page code
- HTML tables in content areas
- Register custom table for WP to use in a plugin
- How to make wordpress use a non-wordpress users table?
- Duplicate rows in meta table, any known relations in WC?
- HTML Form Submit to table in same page
- In WordPress, I want to run a loop to get posts in tabular format
- If I update WordPress my custom data will be deleted from the wp_users table?
- Editing mysql tables/database with wordpress or other app/cms
- Pagination in html table is not working
- How to insert dash (-) into database using wpdb and new_to_publish hook?
- Can i set css class for table via TinyMCE [closed]
- How to avoid repeating similar properties for all tds of a table in a wordpress post
- Can’t create tables with my plugin
- Serial Number from custom table not appear in woocommerce_email_before_order_table action
- Create multiple pages with tables from json file
- Table Sorter sort by span title?
- WordPress search on a custom table
- Plugins custom table not being created on activation
- Right way to store a large set of similar information on website? [duplicate]
- How to edit custom table data in frontend
- I want to schedule email (date, time is in database->table) wp_schedule_event() not working
- How to display custom fields as table in Woocommerce
- How to map data on CSV to web pages?
- Table styles disappear when updating content
- Need help for creating custom table on wordpress
- Show a table from data submitted by a form from a user
- Adding list of Indexes in wordpress document
- Loop posts in a table ordered by a custom field value
- MySQL swap one table for another?
- Plugin does not create a custom table upon activation
- Insert double entry in DB
- Database custom table issues – incorrect result displayed
- MailPress plugin: table inline style tag removed when sending the newsletter
- get_var result empty for query of custom table in plugin admin
- Create hundreds of users with just ID in phpMyAdmin
- How to list Tags using get_tags in an html table?
- get the count of table rows
- Add new MCE button for toggle specific cell background color
- How to get value from wp_usermeta table in database?
- Share or sync user table data with another user table
- Have WordPress Use a Different Database for users
- How to set an exact search box in tablepress plug-in
- Extra HTML code added to my (on Chrome DevTools) but not on source code