I would say the problem is first array. Change it to
array(
'name' => $_POST['name']
),
You can also use wpdb->show_error() or wpdb->print_error()
To Samuel Elh: wpdb->insert() can escape value itself
Related Posts:
- Retrieving custom fields with $wpdb->get_results
- Really simple query giving error in SQL syntax
- SQL query for custom taxonomy slugs
- How to optimize multiple insert into wordpress database
- How to store sensitive user data (passwords)
- Should I use wpdb prepare?
- Is it mandatory to use $wpdb->prefix in custom tables
- $wpdb->insert_id
- Check for success of $wpdb->update() correctly
- Getting wrong relationship value in $args in wp_Query?
- WordPress and multithreading
- $wpdb->insert is changing a value
- Actions or filters fired when data is saved in a custom table
- Display only certain posts based on visitor’s country?
- Custom Plugin Database relations
- why creating tables using $wpdb is not being executed while installing plugins?
- How to use mysql IN statement with wpdb update method?
- How to add SQL file with PHP to WordPress database [closed]
- Using $wpdb object in a widget
- Activation hook not creating table
- $wpdb -> Batch insert from XML File?
- How to Download and install plugin database remotely
- How to insert data to a database table when the field is not yet created?
- Where to store the name of a custom table?
- include wp-blog-header not working on MAMP
- creating custom function to log actions in plugin
- Issue regarding $wpdb->prepare()
- Error on inserting a form value to database
- How to create database table, add data, update and delete using wpdb via plugins?
- Using WPDB to output raw XML fails because of wp-blog-header.php
- how to search users by ajax live search
- Adding custom end points, No error line
- Intermittent database errors when accessing WordPress database
- Storing data in wordpress database from ajax call from different website
- wpdb->prepare and mysql UPDATE – how is it done?
- $wpdb->prepare with LIKE and sprintf
- $wpdb->update() always need a second try
- Using AND and bracket grouping in SQL not working
- Data inserted by wpdb insert is different than data pressnt in database.
- Proper Prepare Statement for ALTER TABLE and using AFTER
- wpdb->get_var always returning 0
- $wpdb->prepare is not working like mysql_real_escape_string
- How to avoid conflicts with db.php / $wpdb and other plugins that decide to use them?
- $wpdb in php 5.5
- Plugin to create Posts and Forums then choose category and parent forum
- $wpdb->update Issue
- How to relate the Category to user?
- WordPress database error: [Query was empty] – using $wpdb->prepare()
- Why doesn’t my Table get created?
- How to display specific data from a custom table to logged in users with a custom role
- $wpbd->insert_id is returning null
- How to get inserted row IDs for bulk/batch insert with wpdb query?
- WordPress Query doesn’t return the correct value
- User avatar-ACF fields
- bindParam? WordPress 4.9.5 SQL LIKE statement %s and %LIKE%
- Update database record in plugin
- Organising and completing posts (mark as read and hide)
- Dedicated server and WPDB Class : huge slow-down of the website
- How to implement pagination into a wpdb->result query?
- How to CRUD from wordpress database in wordpress theme?
- $wpdb how can i save my postmeta table before querying it
- How to add chunk of php, html, and sql code to variable an append to $content
- WordPress plugin tables become corrupt
- Nothing happens on WordPress Update command
- Fixing plugin for wpdb::prepare
- Get all the related data from WordPress DB
- select rows based on exact time (hours, minutes and seconds)
- multiple record insert creating many duplicate records
- Pagination with custom SQL query
- Change default admin page for specific role(s)
- Check for dependent plugin and if false dont activate plugin
- Show message on wordpress admin dashboard
- Log in from one wordpress website to another wordpress website
- Unit Testing a Plugin functionality with cron
- Is it possible for a plugin to register a page template file?
- Error “Call to a member function switch_to_locale() on null” during insert_with_markers
- multiple functions with same filter
- call_user_func_array() expects parameter 1 to be a valid callback, array must have exactly two members
- How to Create Custom HTML Tag on Editor in `Text(HTML)` mode
- null callback in add_settings_section
- Is there a Filter that I can use to filter the tags before they are inserted in to the database?
- How can I pass get_the_author_meta(‘user_email’) through the REST API?
- AJAX form post returns 0
- Update custom plugin with WP-CLI
- Update wordpress Core Remotely
- Proper way to use useSelect
- Access to apache logs from plugin
- Two different wordpress sites – same server and IP address. Gaining Access to database 1 of 2
- Translating plugin settings page – dropdown list
- Hide one specific woocoomerce product
- Remove Meta-boxes (Yoast SEO plugin) [duplicate]
- Can I use a custom post type as a custom taxonomy for a different custom post type?
- wp_schedule_single_event is set correctly but sometimes not fired
- wp.media gallery collection sometimes undefined
- $ is not defined [duplicate]
- How do WordPress plugins work with oAuth2 APIs?
- WordPress mails being sent from @locahost and being rejected
- problem with blank page
- Cannot echo a JS variable to a jQuery plugin coming from wp_localize_script
- Plugin SVN folder structure