I'm using https://github.com/j4mie/idiorm and query DB like this:
$result = ORM::for_table('users')->join('messages', array('users.uid', '=', 'messages.uid'))->where('mid', '5')->find_many();
and now i wanna to add a condition:
$result = ORM::for_table('users')->join('messages', array('users.uid', '=', 'messages.uid'));
if(true) {
$result->where('mid', '5');
}
$result->find_many();
However it doesn't work.