DB.PHP - PHP ORM

Query where

First initialize query object:

$query = new \db\query ();

Than let us add custom select criteria:

$query->where($database->hero->field('damage').">".\db\string($_REQUES['damage'])
." or ".$database->hero->value('race',$_REQUEST['race']));

Run query:

$heroes = $database->hero->load ($query);

You can also use:

$query->where->string .= ' AND ...';

And also set something that is string or reacts properly on strval()

$query->where = $my_strval_object;

With queries you can adjust order, limit, group, join, cache type, pager usage and debug option. Next chapters will show you these tricks. But make sure you have read previous chapter about query helper functions like \db\table::name and \db\table::field or \db\string or \db\id.