I'm developing a web service and one of the parameters it takes is a list of device IDs (energy_mon_id). The list is comma separated e.g. 0,1,2 (the other two parameters it takes are dateFrom and dateTo).
My prepared statement looks like this:
$this->sql = "SELECT $vars FROM $table "
. "WHERE energy_mon_id IN(:energy_mon_id) AND CONCAT(date, ' ', time) "
. "BETWEEN :dateFrom AND :dateTo "
. "$group ORDER BY $orderBy $limit";
The problem is that instead of recognising these as individual comma separated characters it's being interpreted as a complete string (I think). I tried to follow this post
I have searched around and found the exact same solution being provided (it seems to work for everyone else but me). I'm quite puzzled, never have I had to directly ask a question myself, so this is my first post!
Thanks for the help in advance.