I've done some more testing and it seems that if I manualy put in the numbers with no quotes it works fine.
$sql = "SELECT * FROM tblVehicles WHERE VehicleID NOT IN (1,2,3,1,1,2,3,2)";
That works exactly as it should. However, if I used quotes
$sql = "SELECT * FROM tblVehicles WHERE VehicleID NOT IN ('1,2,3,1,1,2,3,2')";
It doesnt seem to take into account anything but the first number.
So my problem here is, why with it not work when I use a php variable with no quotes? Like this
$sql = "SELECT * FROM tblVehicles WHERE VehicleID NOT IN ($theList)";
That causes an error that says "You have an error in your SQL statement".
If I use quotes like this
$sql = "SELECT * FROM tblVehicles WHERE VehicleID NOT IN ('$theList')";
I get no errors, but it returns results that shouldn't be there....ugh.