wpdb::insert( 'table', array( 'column' => 'foo', 'field' => 'bar' ) )
wpdb::insert( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( '%s', '%d' ) )
public insert ( string $table, array $data, array | string $format = null ) : integer | false | ||
$table | string | table name |
$data | array | Data to insert (in column => value pairs). Both $data columns and $data values should be "raw" (neither should be SQL escaped). |
$format | array | string | Optional. An array of formats to be mapped to each of the value in $data. If string, that format will be used for all of the values in $data. A format is one of '%d', '%f', '%s' (integer, float, string). If omitted, all values in $data will be treated as strings unless otherwise specified in wpdb::$field_types. |
리턴 | integer | false | The number of rows inserted, or false on error. |