Db\Adapter\Pdo::rollback

public rollback ([mixed $nesting]) Rollbacks the active transaction in the connection

Db\Adapter\Pdo::query

public query (mixed $sqlStatement, [mixed $bindParams], [mixed $bindTypes]) Sends SQL statements to the database server returning the success state. Use this method only when the SQL statement sent to the server is returning rows //Querying data $resultset = $connection->query("SELECT * FROM robots WHERE type='mechanical'"); $resultset = $connection->query("SELECT * FROM robots WHERE type=?", array("mechanical"));

Db\Adapter\Pdo::prepare

public prepare (mixed $sqlStatement) Returns a PDO prepared statement to be executed with ‘executePrepared’ use Phalcon\Db\Column; $statement = $db->prepare('SELECT * FROM robots WHERE name = :name'); $result = $connection->executePrepared($statement, ['name' => 'Voltron'], ['name' => Column::BIND_PARAM_INT]);

Db\Adapter\Pdo::lastInsertId

public int | boolean lastInsertId ([string $sequenceName]) Returns the insert id for the auto_increment/serial column inserted in the lastest executed SQL statement //Inserting a new robot $success = $connection->insert( "robots", array("Astro Boy", 1952), array("name", "year") ); //Getting the generated id $id = $connection->lastInsertId();

Db\Adapter\Pdo::isUnderTransaction

public isUnderTransaction () Checks whether the connection is under a transaction $connection->begin(); var_dump($connection->isUnderTransaction()); //true

Db\Adapter\Pdo::getTransactionLevel

public getTransactionLevel () Returns the current transaction nesting level

Db\Adapter\Pdo::getInternalHandler

public getInternalHandler () Return internal PDO handler

Db\Adapter\Pdo::getErrorInfo

public array getErrorInfo () Return the error info, if any

Db\Adapter\Pdo::executePrepared

public PDOStatement executePrepared (PDOStatement $statement, array $placeholders, array $dataTypes) Executes a prepared statement binding. This function uses integer indexes starting from zero use Phalcon\Db\Column; $statement = $db->prepare('SELECT * FROM robots WHERE name = :name'); $result = $connection->executePrepared($statement, ['name' => 'Voltron'], ['name' => Column::BIND_PARAM_INT]);

Db\Adapter\Pdo::execute

public execute (mixed $sqlStatement, [mixed $bindParams], [mixed $bindTypes]) Sends SQL statements to the database server returning the success state. Use this method only when the SQL statement sent to the server doesn’t return any rows //Inserting data $success = $connection->execute("INSERT INTO robots VALUES (1, 'Astro Boy')"); $success = $connection->execute("INSERT INTO robots VALUES (?, ?)", array(1, 'Astro Boy'));