$config = array(
"dbname" => "//localhost/dbname",
"username" => "oracle",
"password" => "oracle"
);
$connection = new Phalcon\Db\Adapter\Pdo\Oracle($config);
Mostra file
Open project: phalcon/incubator
Property | Type | Description | |
---|---|---|---|
$_dialectType | |||
$_type | @codingStandardsIgnoreStart |
Method | Description | |
---|---|---|
connect ( array $descriptor = null ) : boolean | This method is automatically called in \Phalcon\Db\Adapter\Pdo constructor. | |
describeColumns ( string $table, string $schema = null ) : Phalcon\Db\ColumnInterface[] | Returns an array of \Phalcon\Db\Column objects describing a table. | |
getDefaultIdValue ( ) : Phalcon\Db\RawValue | Return the default identity value to insert in an identity column. | |
lastInsertId ( string $sequenceName = null ) : integer | Returns the insert id for the auto_increment/serial column inserted in the latest executed SQL statement. | |
supportSequences ( ) : boolean | Check whether the database system requires a sequence to produce auto-numeric values. | |
useExplicitIdValue ( ) : boolean | Check whether the database system requires an explicit value for identity columns; |
var_dump($connection->describeColumns('posts'));
public describeColumns ( string $table, string $schema = null ) : Phalcon\Db\ColumnInterface[] | ||
$table | string | |
$schema | string | |
return | Phalcon\Db\ColumnInterface[] |
public getDefaultIdValue ( ) : Phalcon\Db\RawValue | ||
return | Phalcon\Db\RawValue |
Inserting a new robot
$success = $connection->insert(
'robots',
['Astro Boy', 1952],
['name', 'year'],
);
Getting the generated id
$id = $connection->lastInsertId();
public lastInsertId ( string $sequenceName = null ) : integer
$sequenceName
string
return
integer
Check whether the database system requires a sequence to produce auto-numeric values.
public supportSequences ( ) : boolean
return
boolean
Check whether the database system requires an explicit value for identity columns;
public useExplicitIdValue ( ) : boolean
return
boolean
Property Details