|
Previous Page |
Solar_Sql_Adapter_Pgsql |
Next Page |
insert()
public
int
insert (
string $table,
array $data
)
Inserts a row of data into a table.
Inherited from Solar_Sql_Adapter.
Parameters
- (string)
$table: The table to insert data into. - (array)
$data: An associative array where the key is the column name and the value is the value to insert for that column.
Returns
- (int) The number of rows affected, typically 1.
Description
Inserts a row of data into a table.
Automatically applies Solar_Sql::quote() to the data values for you.
For example:
<?php
$sql = Solar::factory('Solar_Sql');
$table = 'invaders';
$data = array(
'foo' => 'bar',
'baz' => 'dib',
'zim' => 'gir'
);
$rows_affected = $sql->insert($table, $data);
// calls 'INSERT INTO invaders (foo, baz, zim) VALUES ("bar", "dib", "gir")'
?> Local
- Overview
- Constants
- Properties
- Methods
- __construct()
- __destruct()
- _checkIdentifier()
- _createSequence()
- _dropIndex()
- _dropSequence()
- _dsn()
- _exception()
- _fetchTableCols()
- _fetchTableList()
- _getCacheKey()
- _getDefault()
- _getTypeSizeScope()
- _modAutoincPrimary()
- _modIndexName()
- _modSelect()
- _modSequenceName()
- _nextSequence()
- _postConnect()
- _select()
- _sqlColdef()
- _sqlCreateTable()
- _sqlSelect()
- addColumn()
- apiVersion()
- begin()
- commit()
- connect()
- createIndex()
- createSequence()
- createTable()
- delete()
- disconnect()
- dropColumn()
- dropIndex()
- dropSequence()
- dropTable()
- dump()
- fetchAll()
- fetchAssoc()
- fetchCol()
- fetchOne()
- fetchPairs()
- fetchPdo()
- fetchSql()
- fetchTableCols()
- fetchTableList()
- fetchValue()
- getPdo()
- getProfile()
- insert()
- lastInsertId()
- locale()
- nextSequence()
- query()
- quote()
- quoteInto()
- quoteMulti()
- rollback()
- setProfiling()
- update()