joshcam/PHP-MySQLi-Database-Class — pull request #114 by avbdr (2014-06-09 10:30:48+00:00)
Title: Subquery / nicer where() api

Added optional 'operator' variable. Backwards compatibility preserved.
```php
$db->where('id', Array(4, 20), 'between');
// or $db->where('id', Array('between' => Array(4, 20) ) );
```

Subquery in selects:
```php
$ids = $db->subQuery ();
$ids->where ("qty", 2, ">");
$ids->get ("products", null, "userId");

$db->where ("id", $ids, 'in');
$res = $db->get ("users");
// Gives SELECT * FROM users WHERE id IN (SELECT userId FROM products WHERE qty > 2)
```

Subquery in inserts:
```php
$userIdQ = $db->subQuery ();
$userIdQ->where ("id", 6);
$userIdQ->getOne ("users", "name"),

$data = Array (
"productName" => "test product",
"userId" => $userIdQ,
"lastUpdated" => $db->now()
);
$id = $db->insert ("products", $data);
// Gives INSERT INTO PRODUCTS (productName, userId, lastUpdated) values ("test product", (SELECT name FROM users WHERE id = 6), NOW());
```