I have an array as the described below :
array is $number
array(84) { [0]=> string(0) "" [1]=> string(10) "12345678" [2]=> string(10) "12345679" [3]=> string(10) "12345610" [4]=> string(10) "12345611" [5]=> string(10) "12345612" [6]=> string(10) "12345613" [7]=> string(10) "12345614"}
Now, I want to make the array bind to my sql query as the desribed below :
$sql = " SELECT id,
FROM cust_data
WHERE whatever IN (:number)";
I've tried using the following method :
$stid = oci_parse($conn, $sql); //Query SQL
$idCollection = oci_new_collection($conn, 'ODCINUMBERLIST', 'SYS');
foreach ($number as $num) {
$idCollection->append($num);
}
oci_bind_by_name($stid, ':number', $idCollection,-1, SQLT_NTY);
oci_execute($stid, OCI_DEFAULT);
oci_fetch_all($stid,$result);
var_dump( $result);
But it just give me the result
array(0) { }
Thank you.