$wpdb->query("INSERT INTO settings-table
(option_name, option_value, option_created, option_edit, option_user)
VALUES
('name-1', 'val-1', current_time('mysql'), current_time('mysql'), 'user-1'),
('name-2', 'val-2', current_time('mysql'), current_time('mysql'), 'user-2'),
('name-3', 'val-3', current_time('mysql'), current_time('mysql'), 'user-3')")
In the query which you had posted, the column names shouldn’t be in string.
Related Posts:
- Using wpdb to connect to a separate database
- How to fetch Data in WordPress using MySQLi or $wpdb
- How to define composite keys with dbDelta()
- Inserting Post Meta From SQL
- Why does dbDelta() not catch MysqlErrors?
- What causes the “max_user_connections” warning on WordPress frontend?
- How to execute mulitple statement SQL queries using $wpdb->query?
- Database slowdown after update to 3.4.1
- wpdb_prepare with multiple or condition
- WordPress database error – Error in SQL syntax – I can’t identify any error?
- Advanced SELECT query with condtional statements
- Redirecting to old domain after migration website
- Create table from array with prepare
- WordPress running SQL query to update database from form
- Have working sql query… trying to adjust it to use $wpdb
- Custom WordPress Table wpdb
- Best practice to limit results in get_row()?
- Trouble running $wpdb->query() with last_insert_id
- Query Column of Specific ID from Database Table
- How to create more than one new wpdb object?
- How to connect and insert data in database of wordpress?
- How to escape percentage sign(%) in sql query with $wpdb->prepare?
- “BS_” rows in postmeta table
- Where is the HTML-handler part in the wpdb class?
- WordPress Database Query works in phpMyAdmin but not in the code
- insert data from a form:: Warning Empty query mysqli::query()
- How can I get $wpdb to show MySQL warnings?
- How To connect to the same WordPress database with different database user
- using same mysql user with many databases
- Uploading to WordPress Database
- MySQL Database User: Which Privileges are needed?
- Will it break my site if I delete all transient records in wp_options table?
- Please explain how WordPress works with MySQL character set and collation at a low level
- Detecting errors generated by $wpdb->get_results()
- wpdb update add current timestamp not working
- Restoring WordPress posts from database only
- Slow wp_term_relationships query
- How might I retrieve a featured post image from an external WP site and display it as a link back?
- Using Dynamic Data Pulled from a MySQL Table in a WordPress Page
- How to close wpdb connection? [duplicate]
- What are conventions about the schema of the $table_prefix
- Migrating non-WordPress CMS to WordPress, lots of data to move — possible solutions?
- Is deleting orphaned wp_options entries safe?
- How to solve slow WordPress site caused by attachment_metadata
- Delete all post meta except featured image
- WooCommerce – Query for ordered products
- Large database causes slow load
- Safe way to find last inserted id in a table?
- Delete duplicate rows from wordpress database where a column is duplicate in phpmyadmin
- Tons of Twitter rows in my database
- How to insert data into MySQL database from the form created in WordPress site
- Select Multiple meta_value from WP DB; Single Query
- Multiple postmeta with same name for one post in wp_postmeta table
- Which is more efficient? Using usermeta, or creating a new MySQL table?
- What happens if I overwrite the current wp_options table with a backup from a week ago?
- CRUD operations using WordPress database API
- Modify Database in Multi-Site wp_usermeta table
- $wpdb doesn’t like to store arrays
- Handling large N data in WordPress
- How to Mirror WordPress database from Remote server to Local server
- Update results, Before deleting the related category [closed]
- A MySQL DB within a MySQL DB
- Is there a way to recover the table wp_term_relationships?
- Trouble Migrating all data blog from WordPress.com to WordPress.org
- How Can I Put Meta_Compare in the Database-Query?
- How do I convert a MySQL database from utf8mb4 to utf8 encoding?
- $wpdb error (Call to a member function insert() on a non-object)
- Is it important to have integers inserted using %d rather than %s?
- I can’t update my data through $wpdb
- Using $wpdb | checking entered email against existing emails in db
- Moving WordPress site to new domain – database import [duplicate]
- Get results from wordpress data custom table
- Outputting query results
- Add row to custom database Table and delete all rows older than 1 day
- add_post_meta — not working
- Select From wpdb – Author/User Directory page
- WordPress database error: [Query was empty] – using $wpdb->prepare()
- $wpdb->insert not inserting all rows
- SELECT rows between two datetimes when the range is dynamic [closed]
- Insert NULL value using prepare()
- How can I find user role in Mysql?
- $wpdb->insert duplicating rows
- Can I use a wpdb object to connect to a non-WordPress Oracle database [duplicate]
- Featured image from custom to WordPress database
- Delete all users meta that named: user_avatar
- Correct and secure way to access a custom SQL database in a custom PHP template file
- Using $wpdb to insert data into a table
- spambot registering without providing email or password, bypassing registration process
- Possible to restore wordpress database from mysql56 and sqlite files?
- Missing latest posts and options after DB migration via phpMyAdmin
- Processing a lot of $wpdb isn’t insert all the data
- Widgets with *internal* links do not display after database migration
- How do i get value from wp_postmeta?
- “MySQL server has gone away” since update to 3.8
- featured image not showing up with mysql_connect
- How to use remote db tables in current config? [duplicate]
- Importing Concrete5 content to WordPress
- why you don’t Implement PDO for access every thing to database
- SQL Query to get post_id from wp_posts and and meta_key(s) from wp_postmeta
- Have WordPress Use a Different Database for users