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?
- Objective Best Practices for Plugin Development? [closed]
- Post meta vs separate database tables
- How do i best handle custom plugin page actions?
- How to create an API for my plugin?
- Is it ever okay to include inline CSS in plugins?
- Plugins in symlinked directories?
- Is it mandatory to use $wpdb->prefix in custom tables
- In Which Contexts are Plugins Responsible for Data Validation/Sanitization?
- Plugin Form Submission Best Practice
- Update Option Stored in Multi-Dimensional Array
- Best way to abort plugin in case of insufficient PHP version?
- How can I configure Docker for developing and deploying a custom theme?
- What do you think about custom designed plugin/theme options UIs?
- No Error Log File, no debug info
- Where to put third party PHP library?
- Is the new WordPress 3.1 admin bar pluggable and how can I extend it?
- How to use PanelColorSettings in custom Gutenberg block?
- Getting a peer review for my new plugin?
- Default table collation on plugin activation?
- Optimize shortcode callbacks
- Using a database view = evil incarnate?
- How to integrate a PHP webmail script into the backend of WordPress?
- Using filters and actions for plugin API?
- Is There A Hook To Process The Content Of The Text Widget?
- How to Change the Entire WordPress Admin panel Look and Feel?
- Writing a plugin that notify my friends of new post that mentions(@) them
- Getting wrong relationship value in $args in wp_Query?
- Plugin Development for registered users
- Search: how to extend the existing search to include a custom table
- Is there documentation reference for forms in menu and setting pages?
- Optimising a big WordPress site
- wpdb->prepare and mysql UPDATE – how is it done?
- Enqueue script globally
- dbDelta SQL Query Not Working
- How to modify files inside wp-includes directory in wordpress
- How should I go about registering JavaScript that isn’t a file? [duplicate]
- dbDelta not installing database
- Is it necessary to do validation again when retrieving data from database?
- Custom entity search and display
- 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
- Adding columns to core tables
- How to query custom db table?
- Delete data from database using row action
- Show dynamic list of products from custom api of another database under same host
- How do I have now a duplicated user entry if this is not allowed (and I cannot replicate it)?
- Show message from backend
- Alternative functions for mysql_free_result and mysql_ping in wordpress functions
- Why in this archive page that call query_posts() function show only the last 10 posts?
- 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?
- How best to handle database version dependence (from $wp_db_version)
- WP: Search and replace in DB programmatically
- Using AND and bracket grouping in SQL not working
- Logout after clicking URL link results in “headers already sent” error
- Two different wordpress sites – same server and IP address. Gaining Access to database 1 of 2
- how to save wp_editor html content in options table
- Converting core modification to a plugin
- Comment “like” problem – “users who like this” avatar linking to current user profile instead of “liker’s” profile
- Plugin Development: Storing and Manipulating Data That Fits JSON in Database
- How to use a WP_Customize_Control outside of the Customizer?
- What might be the reason of Couldn’t fetch mysqli_result on another domain?
- How do I debug an error that a plugin is causing?
- How to replace settings in WordPress plugin from a theme
- Save temporary registration data
- How to remove/replace current page template?
- Update plugin settings option_name for big plugin update
- $wpdb->update Issue
- Integrating Custom Database with WordPress
- dbdelta failing with error: “WordPress database error Table ‘wp_2_myPlugin’ already exists
- Setting a post’s category
- WordPress database error: [Query was empty] – using $wpdb->prepare()
- Extract Information from post content (using regex?)
- How to determine which capability to use?
- Serial Number from custom table not appear in woocommerce_email_before_order_table action
- 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
- Error code when migrate
- How to create a custom post-new.php page for plugin , no wp menu
- Want to know how to reveal a WordPress theme, considering the theme name is hidden?
- Why User_login key doesn’t work with wp_update_user()
- How to get inserted row IDs for bulk/batch insert with wpdb query?
- Save meta box data from selected dropdown list in bbpress reply form
- Metabox types list
- Where to save Gutenberg plugin data?
- Rate limiting ajax requests in WordPress
- WordPress Fatal error: Uncaught Error: Call to undefined function dbDelta()
- 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
- Use admin-post to submit form data to external database
- Set widget icon in Customizer?
- Save in my custom admin page and redirect to the saved object
- Relational / Associate tables using native WordPress functionality