Using Propel

Why not use Propel as DB-Framework? It is very powerful and easy to use.

Some examples:

Simple insert:


/* initialize Propel, etc. */

$author = new Author();




Simple Criteria:


$c = new Criteria();

$c->add(AuthorPeer::FIRST_NAME, "Karl");

$c->add(AuthorPeer::LAST_NAME, "Marx", Criteria::NOT_EQUAL);

$authors = AuthorPeer::doSelect($c);

// $authors contains array of Author objects

In version 1.3 they are switching from Creole to PDO which is much more faster. I use Propel 1.2 in my Prado3 project and it was easy to implement.

Yii's ActiveRecord is also very powerful. To accomplish the same task, you can use Yii AR as follows,

$author=new Author;




There are also very powerful support for queries in Yii AR.