- Just use the wpdb insert and update API, no escaping or sanitizing needed as per the doc, just the raw data.
Data: (array) Data to replace (in column => value pairs). Both $data columns
and $data values should be “raw” (neither should be SQL escaped).
Something like:
$wpdb->insert(
$wpdb->prefix . "myTable",
array(
"doiBody" => $_POST['doi-body']
),
array( "%s" )
);
- No wpautop use is needed if you are outputting into the wp_editor textarea, just an
esc_attr( $output )
would be sufficient I believe.
Hope this helps somehow.
Related Posts:
- wpdb get_results() and prepare when to use prepare?
- sanitize_text_field and apostrophe problem
- wpdb->insert: do I need to prepare against SQL injection?
- How do I check for a duplicate record before inserting using wpdb
- WPDB prepare – like % – placeholders?
- $wpdb->update multiple rows, like IN in normal SQL
- Matching database content types to PHP types
- Avoiding “Usage of a direct database call is discouraged”
- dbDelta does not create Table, but returns success
- passing variables as parameters to stored procedures via wpdb from php-script
- wp-content/db.php : where is this file?
- Quotes in table name
- WPDB->insert with special characters
- How Can I Use $wpdb in PayPal IPN file?
- $wpdb->query() multiple query support
- Is there a (better) way to access $wpdb results?
- Set media metadata (i.e. “dimensions” field) on SVG file after extracting it with a filter
- how to execute different sql query in non-sanitized $wpdb->get_results function
- $wpdb not returning data
- $wpdb Query Result not coming but in phpmyadmin it works [closed]
- WPDB update row with != in where clause
- How to email user after inserting the username in database in WordPress
- Create an array with a string key from wpdb->get_results
- How to fetch an array in $wpdb?
- $wpdb – do you have to use foreach even if there will always only be one result?
- Need help writing a $wpdb query
- get the number of queries made on a page(inside my plugin)
- Doing a loop with multiple DBs simultaneoulsy
- $wpdb->insert query changes to SHOW COLUMNS query Output
- Fixing wpdb->get_results and wpdb->prepare?
- How does the WXR file differ from the WPDB?
- Rolling Back from current WordPress version to previous one
- WPDB If primary key already exists, add +1 to integer field
- What is wrong with this wpdb update?
- using $wpdb to insert a form into a post
- Programmatically Creating Page using $wpdb and getting 404 error
- wp_create_user not properly entering password
- Constructing a dynamic WPDB query with multiple LIKEs
- Foreach loop not working as expected – custom tables and references while submitting a form
- Query insert query executing multiple times
- Undefined offset: 0
- Connect to separate database using $wpdb and authenticate user
- How to access PostgreSQL using WPDB?
- how to use $wpdb->prepare to update a custom table
- Counting posts with argument without retrieving the posts
- how to assign content to a different author while loading content
- $wpdb->insert inserting only f character in custom table
- Why does wpdb->update delete other meta?
- Increment integer field in database when WHERE needs to be dynamic [closed]
- Create new database through static page code
- Custom $wpdb returns unexpected time based results
- Register custom table for WP to use in a plugin
- wpdb->get_row is selecting the variable as a column name
- WordPress “wpdb->update” – Append Text Value
- Display category names on edit user profile using $wpdb
- Need help converting get_user_meta [keys] into own array
- Can’t call WPDB inside RSS template
- wpdb and acf via wp rest api
- WPDB SQL Ignore `post_status` Parameter
- Save sql file after doing insert wpdb
- wpquery properties last_query and last_result : should these be public or private?
- Can I use wpdb to insert query results into a post?
- $wpdb->prepare error after WordPress update [duplicate]
- Query and get meta as object(stdClass) on wp postmeta table?
- How do I query a table?
- check that the data exists before sending it to wpdb
- How to pass an input value into wpdb->Prepare
- wpdb->insert with special chars failing with collation utf8mb4_unicode_520_ci
- no result returns when using $wpdb->get_results with where clause
- SQL queries to another wordpress site
- PHP | left join avg query give me Array()
- update not working using wpdb
- get_posts() SQL Injection
- og:image functions.php
- $wpdb select returns empty array
- Show error messages to a user when database insert fails
- Debugging db calls: $wpdb->insert works on test site, not on identical production site
- Intermittent problem writing update_user_meta
- How to use WHERE NOT EXISTS query to avoid duplicate entry using $wpdb to save in custom table?
- Combine posts and postmeta
- wpdb get_row database query inquiry
- Depreciated Call -> Function wpdb::escape()
- How do I update post based on meta_key in another table?
- wpdb insert working in one function, but not another
- Inserting and updating rows with wpdb indreases integer fields by 1 point sometimes
- Retrieve a list of users based on some conditions
- wp_commentdata: error in documentation?
- Echo only gives me the first part of string
- wp-postratings: list current user’s unrated posts
- wpdb select from using array as search parameters
- esc_sql inserting weird chars to DB
- Error inserting row into table
- Retriving array size from serialized data
- How to update user profile or inputing any data to the wp db from external site?
- Can’t get expected result from a wpdb query
- Get comments after specific date
- selecting row using wpdb which contain special symbols
- get only 1 wpdb and get taxonomy, post to next page [closed]
- Query Problem in Clustom Plugin
- WP Recommended Table Exclusions?