[eluser]richard_ctv[/eluser]
[quote author="audiopleb" date="1186159936"].
The only thing i have to work out now is how to get the selections seperated by "OR" surrounded by brackets!
Wish me luck
[/quote]
Something like this (not tested):
Code:
$test_array = array(
'field1' => array( 'test1', 'test2' ),
'field2' => array( 'test3', 'test4' ),
'field3' => array( 'test5', 'test6' ),
);
$ANDS = array();
foreach( $test_array as $field => $data ){
$ORS = array();
foreach( $data as $test ){
// takes $field from outer loop
array_push( $ORS, "($field = $test)" );
}
array_push( $ANDS, $ORS );
}
$where = join( " AND ", $ORS );