PHP是否可以从表中检查变量是数组的数据?

Is it possible to check data from table where variable is an array?

Example:

$allowedIP = array();
$qChkIP = oci_parse($c1, "SELECT ALLOWED_IP_ADDRESS FROM WA_BT_TBL_PROFILE WHERE ACTIVE = 'Y'");
oci_execute($qChkIP);
while($dChkIP = oci_fetch_array($qChkIP))
{
    $allowedIP = array_merge($allowedIP, array_map('trim', explode(',', $dChkIP['ALLOWED_IP_ADDRESS'])));
}

print_r $allowedIP

Array ( [0] => 192.168.183.205 [1] => 192.168.184.20 [2] => 192.168.184.15 [3] => 192.168.183.28 )

My current IP Address is: 192.168.183.28

and now I want to get detail information from table where ALLOWED_IP_ADDRESS = $allowedIP

SELECT P.ALLOWED_IP_ADDRESS, P.PROFILEID, P.PROFILE_NAME, P.LOCATIONID_FK, L.LOCATIONID, L.LOCATIONNAME FROM WA_BT_TBL_PROFILE P, WA_GA_TBL_LOCATIONS L WHERE P.LOCATIONID_FK = L.LOCATIONID AND P.ACTIVE = 'Y' AND P.ALLOWED_IP_ADDRESS IN (".implode(',',$allowedIP).")

But there is no result.

UPDATED

DATA

PROFILEID   PROFILE_NAME        ACTIVE  DATEADDED               ADDEDBY LOCATIONID_FK   ALLOWED_IP_ADDRESS
PF0001      Normal Working Day  Y       9/30/2017 5:53:39 PM    US0001  LC0001          192.168.183.205
PF0004      Ramadhan            N       10/12/2017 10:38:02 AM  US0001  LC0003  
PF0002      Ramadhan            N       9/30/2017 5:55:50 PM    US0001  LC0001          192.168.183.205
PF0003      Normal Working Day  Y       10/3/2017 5:23:05 PM    US0001  LC0003          192.168.184.20, 192.168.183.28

I'm using this method from Randall

"... P.ALLOWED_IP_ADDRESS IN ('".implode("','",$allowedIP)."') ..."

and I can see the data but result is not correct. I got "PF0001", should be "PF0003"

You need to single quote each IP in the "IN" value, you have:

"... P.ALLOWED_IP_ADDRESS IN (".implode(',',$allowedIP).") ..."

Which would make something like this (which is invalid sql):

P.ALLOWED_IP_ADDRESS IN (11.11.11.11,22.22.22.22,33.33.33.33)

A basic way is like this:

"... P.ALLOWED_IP_ADDRESS IN ('".implode("','",$allowedIP)."') ..."

Which ends up as (more valid sql):

P.ALLOWED_IP_ADDRESS IN ('11.11.11.11','22.22.22.22','33.33.33.33')

You can get more involved if you wish to sanitize the data for safety, but I think thats beyond the need of the answer.