I have a where clause that is in an array, I am having a problem where i need service.active = 1 to also possible match 2,3 or 4.
I am not sure how to do this in an array. So i wanted:
service.active = 1 OR service.active = 2 OR service.active 3 OR service.active = 4
at the moment i can only get it to work by 'service.active' => 1,
#Get the data
$services = get_services(array(
'service.id' => $service_id, //Service we are trying to get
'service.active' => 1, //Active services only
'service.owner_id' => $userid, //Just to be sure another user isn't trying to get a service that isn't theirs
));
Answered by Daryl B in this comment:
Have an SQL statement like this? SELECT * FROM service WHERE service.active IN (1,2,3,4); Dont use OR it can cause problems and its a bit slow. I dont know if you are using a RAW SQL query or a PDO prepared statement to help further. But you can implode the array to get the list