Methods

Set the table and columns for an insert.

__construct(mixed $table, array $columns) 

Parameters

$table

mixed

table name or array($table, $alias) or object

$columns

array

column names

Set the columns that will be inserted.

columns(array $columns) : \Fuel\Core\Database_Query_Builder_Insert

fluent This method is part of a fluent interface and will return the same instance

Parameters

$columns

array

column names

Returns

Compile the SQL query and return it.

compile(mixed $db) : string

Parameters

$db

mixed

Database instance or instance name

Returns

string

Reset the query parameters

reset() : \Fuel\Core\Database_Query_Builder_Insert

fluent This method is part of a fluent interface and will return the same instance

Returns

Use a sub-query to for the inserted values.

select(\Fuel\Core\Database_Query $query) : \Fuel\Core\Database_Query_Builder_Insert

fluent This method is part of a fluent interface and will return the same instance

Parameters

$query

\Fuel\Core\Database_Query

Database_Query of SELECT type

Exceptions

\FuelException

Returns

This is a wrapper function for calling columns() and values().

set(array $pairs) : \Fuel\Core\Database_Query_Builder_Insert

fluent This method is part of a fluent interface and will return the same instance

Parameters

$pairs

array

column value pairs

Returns

Sets the table to insert into.

table(mixed $table) : \Fuel\Core\Database_Query_Builder_Insert

fluent This method is part of a fluent interface and will return the same instance

Parameters

$table

mixed

table name or array($table, $alias) or object

Returns

Adds values.

values(array $values) : \Fuel\Core\Database_Query_Builder_Insert

Multiple value sets can be added.

fluent This method is part of a fluent interface and will return the same instance

Parameters

$values

array

Exceptions

\FuelException

Returns

 Properties

 

<p>columns</p>

$_columns : array

 

<p>table</p>

$_table : string

 

<p>values</p>

$_values : array