Make sure that the value portion of the data parameter’s column=>value pairs must be
scalar. If you pass an array (or object) as a value to be inserted you will generate a warning similar to mysql_real_escape_string()
expects parameter 1 to be string, array given on line 880 in file
/var/www/html/wp-includes/wp-db.php”.
Rather then above your code is looking correct with :
<?php $wpdb->insert( $table, $data, $format ); ?>
So finally check that every $_POST
are not in array format.
Related Posts:
- Differences between wpdb->get_results() and wpdb->query()
- How to Use Wildcards in $wpdb Queries Using $wpdb->get_results & $wpdb->prepare?
- wpdb get posts by taxonomy SQL
- Multipart/formatted MySQL query problem
- Custom $wpdb Query for Custom Post Type by Category
- Can’t pass table to $wpdb->prepare
- $wpdb->get_var not returning a result
- Most effective use of DB querys
- $wpdb->query() vs. $wpdb->get_results() vs. phpMyAdmin
- wpdb::prepare() isn’t working
- $wpdb doesn’t appear to work on page inside of a plugin
- Strange string in console from wpdb query
- Using $wpdb->update but confused on the WHERE in and SET
- What’s wrong with my $wpdb prepare?
- Make one query for adding entries to database
- How to execute a SQL-query which contains multiple queries using $wpdb->query?
- Alter a specific query on WordPress
- wpdb->term_taxonomy count posts from both published and private posts?
- wpdb print all post meta
- Plugin will sort users by usermeta
- wpdb query problem to access previous 3 days posts
- How to write: $wpdb->update having WHERE NOT value pair in the array
- I can’t figure out what’s wrong with this statement. $wpdb->query update
- Use mysql_query instead of $wpdb query
- wpdb COALESCE won’t work
- Custom Query – Based on user input
- Custom SQL Query passing array to WHERE p.id
- Get posts from category with custom query
- Custom Query returns array, but I can’t see it’s elements
- Valid SQL query return empty
- mysql query – how to escape apostrophe?
- $wpdb->prepare affecting the query?
- prepare function sql safe method
- Updating with $qpdb->query() always returns 0 rows affected
- How to return count of custom post type posts with a specific custom field value via $wpdb?
- WordPress Mysql query and Duplicate
- How do I query for posts by custom meta and those that have been stickied?
- Help with Related Posts Function
- wpdb update multiple row?
- Formatting a date/time returned from a custom $wpdb query
- Improve performance of slow query
- How do I get specific readable results from this query and array results
- implementing my wp_query using $wpdb class
- Exclude Posts from a Widget
- Fastest and most efficient SQL query to check if UID exists
- Use $wpdb->get_results with filter based on array
- $wpdb query for price in custom field value
- Display result from custom post meta query
- Wpdb empty result only if language is Russian
- Run an update query in a function
- Problem on wpdb queries, wp_insert_post, wp_insert_user etc. The query runs twice
- Update vs Insert logic but the last key is always inserted?
- There is way to improve this query? wordpress get post data and some meta data
- $wpdb: how to use a query as a base for another query?
- Wpdb generates too many queries
- Custom Query for searching through custom fields
- Mysql query and odd results
- How to reference same column name but different table in custom db query
- Retrieving custom field array value through db query
- How to get one result using wpdb class?
- Delete query won’t run
- update $wpdb one query
- How to get comments by post ID?
- Create pagination and order according to alphabet
- How to display Section for certain time
- Query set using tax_query with relation ‘OR’ modifies category object?
- When add_query_arg() is necessary?
- Filter query posts by the count of metas for a meta key
- Save default value for empty or missing post meta
- Listing posts by grouping dates
- Query posts by content lenght
- How to export current year posts from WordPress?
- Search query -> Show all pages except certain template
- WordPress Query wp-terms SLOW
- Different values for get_author_posts_url and get_the_author (posts 2 posts)
- query statement containing variable won’t execute
- Placing a widget with $wpdb query
- Related post based on content
- How to interfere to default search to make it search in custom fields?
- WP_User_Query with more than two custom meta values
- Declaring a var, placing it in a query and using the output of the query?
- Sort query_terms_list for post_tags alphabetically
- Target a page with query
- List only parent attributes on woocommerce admin atrributes page
- Add rewrite rule for archive search
- How to create a filter and add query params to all links
- My custom pagination not displaying
- Wpdb->last_query returns bad query
- WP search exclude last letter from string
- Query reversed when I use “category__not_in”
- How to reduce the load / no of queries on MySql Database
- Show certain number of post from tags
- Query for distance OR taxonomy term
- Ajax Form data is not posted back to the get_results()
- How to query custom post type one after another
- Apply ordering args to newly merged queried
- Get blog id of subdirectory multisite blog from name – *outside* of wordpress request processing
- Remove last comma from this query
- WordPress Unknown Query
- List of buyers for each product