where in -clause on server side
where in -clause on server side
Hi,
Is it possible to use where in -clause on server side? I need where clause like this:
$data = Editor::inst( $db, 'wall_info', 'id' )
->fields(
Field::inst( 'id' ),
Field::inst( 'name' ),
)
->where('id','(238,239,400,500)','in')
->process( $_POST )
->data();
I'm using MariaDB and normal query for example: select name from tablexz where id in (238,239,400,500); works fine from commandline.
Appreciate if You could help me on this one.
BR, Toni
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi Toni,
Currently no, I'm afraid there isn't. It is something that I'm going to be looking at adding in future, but at the moment you would need to use
or
statements to do this.In the 1.4 beta which just going to release later today you will be able to use a closure to make more complex conditions such as the or statements:
Not ideal I realise, but it will perform the same action, and if you have the information in an array you could use a little loop.
As I say, this ability to use a closure function will be in the 1.4 beta released later today.
Allan
Cheers! Thank you for the fast reply.