This part in your table creation SQL looks wrong: DEFAULT CHARSET=CHARSET=utf8
. It should just be DEFAULT CHARSET=utf8
.
Also, dbDelta()
is quite a delicate function. Don’t ask me why, but you need to put a double space after the PRIMARY KEY
keyword. You also need to get rid of the quotes around the field names because dbDelta()
chokes on those. Don’t use backticks neither.
And, of course, set WP_DEBUG
to TRUE
while debugging.
Related Posts:
- WordPress how do I echo SUM from a column of a MySQL table by user id AND type_operation
- Associating special meaning with user id 0
- Can I log the searches that are returning 404 in the DB?
- Is it ever okay to include inline CSS in plugins?
- Is it mandatory to use $wpdb->prefix in custom tables
- How can I configure Docker for developing and deploying a custom theme?
- Is the new WordPress 3.1 admin bar pluggable and how can I extend it?
- Getting a peer review for my new plugin?
- Default table collation on plugin activation?
- Using filters and actions for plugin API?
- How to Change the Entire WordPress Admin panel Look and Feel?
- Getting wrong relationship value in $args in wp_Query?
- Allowing for multiple template views on the Gallery Settings page when using the Visual Editor
- Using Primary Color in Plugin Block
- What is the added “complexity” of custom tables?
- How is the data stored in the database?
- When is it appropriate to put functions on page template vs. functions.php?
- How to modify post content before writing to database?
- Actions or filters fired when data is saved in a custom table
- How to use wp_set_password in a plugin?
- Is there any reason only 1 (my) IP would be added to this table using $wpdn->insert?
- How to store data for posts/pages built with drag-n-drop builder?
- Delete a specific item menu when I deactivate my plugin
- What for the tables ending with the meta used in database of wordpress?
- Creating table with plugin is not working
- Get the password key when using the wp_new_user_notification_email filter
- Order properties should not be accessed directly
- dbDelta() Error – Incorrect index name ” for query ALTER TABLE
- How to deal with equal & similar arguments for a function?
- Update/insert only a column of database table
- Executing a function upon webhook calling wordpress
- How to Create database table when Plugin installed/activated, and delete database when Plugin deleted
- Customizer: widget-synced triggers twice
- WordPress not working on localhost
- how to use hook deleted_user into custom function to delete user from custom table
- Where to store the name of a custom table?
- WordPress is automatically linking plain text email addresses
- Is Using WordPress Supplied WYSIWYG Advisable?
- ServerSideRender and Media Object: attributes passing image data object to php renderer even though it’s not set
- I’m designing a plugin to create database indexes. Suggestions?
- WordPress database error for query INSERT INTO
- How to connect to AWS RDS external database (not for the core WordPress db)
- Clearing caches on plugin uninstall
- How to use a hook to override an update_post_meta call in a plugin?
- Are there any scripts, classes, and/or functions built-in to WP for a plugin to export/import its saved data from wp_options?
- Strange issue saving custom field data for a WooCommerce order
- Form doesnt save to database
- Updating Woocommerce Settings API when WordPress Settings API saved and vise versa
- Is using custom table to suit business needs instead of transients a big hit to page load speed?
- Optimising a big WordPress site
- How to modify files inside wp-includes directory in wordpress
- How to set a cookie for logged in users to md5($user->ID . “my_secret”)?
- What is the best way to store a few fields?
- Loading Modernizr (or other JavaScript libraries) for use in a plugin
- Alternative functions for mysql_free_result and mysql_ping in wordpress functions
- Make Database query only when option is updated
- Create Widget or Enable Shortcodes in Sidebar
- Can we intercept user_login and user_pass from a wp_login_form?
- Logout after clicking URL link results in “headers already sent” error
- Plugin Development: Storing and Manipulating Data That Fits JSON in Database
- How to use a WP_Customize_Control outside of the Customizer?
- How do I debug an error that a plugin is causing?
- Update plugin settings option_name for big plugin update
- Integrating Custom Database with WordPress
- Setting a post’s category
- WordPress database error: [Query was empty] – using $wpdb->prepare()
- Extract Information from post content (using regex?)
- Customise Grouped Product display in Woocommerce with custom column
- Custom Endpoint – Does it possible to use PUT method with WP API Rest?
- Why won’t this submenu page show? – My First WordPress Plugin
- How to get inserted row IDs for bulk/batch insert with wpdb query?
- Metabox types list
- Where to save Gutenberg plugin data?
- Rate limiting ajax requests in WordPress
- Does hooking into a plugin action / filter override the plugin’s function for that hook?
- How to prevent users from deleting their accounts?
- Hiding class namespace from plugin’s extensions
- Set widget icon in Customizer?
- Save in my custom admin page and redirect to the saved object
- Relational / Associate tables using native WordPress functionality
- Determine if the current page, is being edited
- WordPress delete mysql rows with string
- How to store in the database directly the translation?
- PHP includes with AJAX actions
- How and when would I implement some code which would take data from one part of the Db and put it in another?
- Custom Post Type and Functions
- Theming Custom Plugin Page
- Best practice: What belongs in theme and what in plugin for large eCommerce website
- Adding class to the parent of current-post-ancestor / current-menu-parent / current-post-parent
- Dynamic banner for use on external sites
- What method should I use to store my plugin data (multi level menus with options on each item)
- Adding Meta box to thrid-party plugin
- How to add additional field in a table row after creating a table?
- WordPress plugin tables become corrupt
- How do I store a custom dataset in WordPress to best take advantage of API?
- Is Explicit Versioning a better alternative to Semantic Versioning for wordpress?
- Custom plugin not appearing
- Leveraging Core Functionality in Icon Upload Plugin [closed]
- Is there any other ways to replicating changes on live from staging without pushing from git
- WordPress database error: [Table ‘bitnami_wordpress.questions’ doesn’t exist]