I am writing the QueryBuilder class for building queries to MySQL, the builder accepts an array with search parameters.
I want the keyword say 'order by'
to get the value, in whatever register it is not passed by the user though 'OrDeR By'
.
Is there any method that can do this? Or who faced this problem prompt.
UPDATE Example input array:
arra1 = array( 'id' => array('>=', 1), 'date' => array('<', time()), 'order by' => array('id', 'DESC'), 'limit' => array(5, 10), ); arra2 = array( 'id' => array('>=', 1), 'date' => array('<', time()), 'ORDER BY' => array('id', 'DESC'), 'LIMIT' => array(5, 10), );
How to make one and the first masiv work the same way. It is impossible to drive all the fields into lower case. The rest of the keys except order by
& limit
table fields.