Db\Adapter::fetchAll

public array fetchAll (string $sqlQuery, [int $fetchMode], [array $bindParams], [array $bindTypes]) Dumps the complete result of a query into an array //Getting all robots with associative indexes only $robots = $connection->fetchAll("SELECT * FROM robots", Phalcon\Db::FETCH_ASSOC); foreach ($robots as $robot) { print_r($robot); } //Getting all robots that contains word "robot" withing the name $robots = $connection->fetchAll("SELECT * FROM robots WHERE name LIKE :name", Phal

Db\Adapter::dropForeignKey

public dropForeignKey (mixed $tableName, mixed $schemaName, mixed $referenceName) Drops a foreign key from a table

Db\Adapter::fetchColumn

public string | ** fetchColumn (string $sqlQuery, [array $placeholders], [int | string $column]) Returns the n’th field of first row in a SQL query result //Getting count of robots $robotsCount = $connection->fetchColumn("SELECT count(*) FROM robots"); print_r($robotsCount); //Getting name of last edited robot $robot = $connection->fetchColumn("SELECT id, name FROM robots order by modified desc", 1); print_r($robot);

Db\Adapter::fetchOne

public fetchOne (mixed $sqlQuery, [mixed $fetchMode], [mixed $bindParams], [mixed $bindTypes]) Returns the first row in a SQL query result //Getting first robot $robot = $connection->fetchOne("SELECT * FROM robots"); print_r($robot); //Getting first robot with associative indexes only $robot = $connection->fetchOne("SELECT * FROM robots", Phalcon\Db::FETCH_ASSOC); print_r($robot);

Db\Adapter::dropTable

public dropTable (mixed $tableName, [mixed $schemaName], [mixed $ifExists]) Drops a table from a schema/database

Db\Adapter::dropPrimaryKey

public dropPrimaryKey (mixed $tableName, mixed $schemaName) Drops a table’s primary key

Db\Adapter::createTable

public createTable (mixed $tableName, mixed $schemaName, array $definition) Creates a table

Db\Adapter::describeReferences

public describeReferences (mixed $table, [mixed $schema]) Lists table references print_r($connection->describeReferences('robots_parts'));

Db\Adapter::createSavepoint

public createSavepoint (mixed $name) Creates a new savepoint

Db\Adapter::createView

public createView (mixed $viewName, array $definition, [mixed $schemaName]) Creates a view