Using Propel

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

Some examples:

Simple insert:

<?php

/* initialize Propel, etc. */

$author = new Author();

$author->setFirstName("Jack");

$author->setLastName("London");

$author->save();

Simple Criteria:

<?php

$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;


$author->firstName='Jack';


$author->lastName='London';


$author->save();


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