rudiedirkx/Rudie-on-wheels — Issue #40: Extend simple query builder with AND and OR classes
Author: rudiedirkx
Created: 2012-01-01 06:42:00+00:00
State: open

Made a start. Something doesn't quite work though. Execute in `/code`:

use row\database\query\queryAND;
use row\database\query\queryOR;

$and1 = QueryAND::create('a = b', 'c > 2');

$and2 = QueryAND::create('x < y', 'x > 10');

$or = QueryOR::create($and1, $and2);

echo $or->render($db);

It returns:

((a = b AND c > 2) OR (a = b AND c > 2) OR (x < y AND x > 10) OR (x < y AND x > 10))

which is a little over the top =) It should return:

(a = b AND c > 2) OR (a = b AND c > 2)