I'm using CodeIgniter and trying to use an array in the WHERE clause to return only rows whose id is found in the array.
Submitted by form:
$arrTID = $this->input->post('Present'); print_r($arrTID);
output:
Array(
[0]=>FMM003
[1]=>30089
[2]=>30097
)
query:
$query = $this->db->query("
select TraineeID
from tbl_attendance_processed
where TraineeID IN $ID
and attnDate='$atnDate'
");
$res = $query->result_array();
I need the query to return the TraineeIDs for the qualifying rows. How do get this?