Umil.table row insert
From phpBB Development Wiki
umil::table_row_insert –– Insert data to a database table using the Umil Library.
Contents |
Description
string umil::table_row_insert ( mixed $table_name [, array $data ] )
Parameters
| Parameter | Required/Default | Usage |
|---|---|---|
| table_name | Required | The name of the database table to remove. You may just use phpbb_ for the table prefix if you would like. UMIL correctly sets the table prefix to the board's default if you enter in phpbb_ |
| data | default array() | An array of arrays of data you would like to insert (exactly the same data as what would be sent to db::sql_multi_insert) |
Return Values
Returns result or umil_end data
Information
This function only acts as a wrapper for the db::sql_multi_insert function to make inserting data simpler with UMIL.
This function is only available in UMIL 1.0.0+
Examples
Example #1
Insert one row into the phpbb_test table
$umil->table_row_insert('phpbb_test', array(
array(
'field1' => 'asdf',
'field2' => 'asdf',
),
));
Example #2
Insert 3 rows into the phpbb_test table
$umil->table_row_insert('phpbb_test', array(
array(
'field1' => 'asdf',
'field2' => 'asdf',
),
array(
'field1' => 'qwer',
'field2' => 'qwer',
),
array(
'field1' => 'zxcv',
'field2' => 'zxcv',
),
));
See Also

