catfan/Medoo — pull request #85 by docmcfly (2014-04-07 21:11:48+00:00)
Title: Update medoo.php - Many features 

New features:
- max, min, count, has, get and avg support SQL joins.
- My Solution for: More conditions in other condition (#78)

AND and OR rotate automatically, but a specification of AND or OR is possible.

follow where clauses are possible (and many more ;) ):
PHP:[ A => B, C=>D]
SQL: A=B AND C=D

PHP: ["AND" => [ A => B, C=>D]]
SQL: A=B AND C=D

PHP: [ A => B, [E=>F, G=>H], C=>D]
SQL: A=B AND (E=F OR G=H) AND C=D

Long example:
PHP:	$where = [ 'OR' =>	[ ['from_domain_id[!]' => [36], 'type[#=]' => "passwor('123')"], ['to_domain_id' => $domain_ids ,'from_domain_id' => $domain_ids,'type' => 'alias']] , 'ORDER' => 'forward_from'];
SLQ: ( "from_domain_id" NOT IN ( 36 ) AND "type" = passwor('123') ) OR ( "to_domain_id" IN ( 356 ) AND "from_domain_id" IN ( 356 ) AND "type" = 'alias' )

- database functions are now usable:
PHP: $where = ['password[#]' => "PASSWORD('secret')" ] :
SLQ: password = PASSWORD('secret')

The # marks functions. The value is not quoted.

bye docmcfly