No problem, Scott. I should have been more clear that IN() is a SQL function, not PHP. What it's useful for is in a WHERE statement to test if what you're SELECTing has a value you're looking for (as you mentioned in the True/False explanation in your post), like this:
SELECT ClientID
FROM tblClient
WHERE ClientFirstName IN('Damien',Tami','Pedro','Sleater')
This example is pure pseudocode, so bear with. I hope it can help:
(basic SELECT query)
$queryhead = "SELECT * FROM tblTableName";
(WHERE clause starting out the IN comparison)
$queryWhere = "WHERE dataelementtocompare IN("
(Close the IN array)
$queryCloseQuote = ")";
(this bit snipped from Goa's example with alterations)
//cycle through array
for ($i = 0; $i < $NbSensor; $i ++)
{
if($i = 0) //for the first element in the array, wrap the dataelement in single quotes, no comma
{
$insertFirstDataPoint .= "'\n" . $sensors [$i] . "'\n"; -- should yield 'dataelement'
}
else
{
$insertSubsequentDataPoints .= ",'\n" . $sensors [$i] . "'\n"; -- should yield ,'dataelement'
$query = $queryHead . $queryWhere . $insertFirstDataPoint . $insertSubsequentDataPoints . $queryCloseQuote
What this should do (when written properly) will construct the following example:
$query = "SELECT * FROM tblTableName WHERE dataelementtocompare IN('data_1','data_2','data_3','data_4'...'data_i')"
The loop part will take some work to make sure it captures all data elements, but I think this would work.