1. Home
  2. Docs
  3. Function Reference
  4. Functions
  5. general_insert_fn()

general_insert_fn()

Insert new data into a database. Close to $wpdb->insert but you don’t have to handle formats, and it will bind your table so any fields not existing in your table will be filtered.

Copy to Clipboard

Parameters

$table_str

Target table, escaped in the function

$data_arr

Data to save to database, escaped in the function

$echoQuery_bln

If true the query will be echoed out (default false)

$prefixMe_bln

If true, prefixes table names with the WordPress table prefix (default true)

Return

mixed

Returns inserted ID, if failed, false will be returned.

Example

Copy to Clipboard

Location

This function can be found here: