The solution is to use a comparison list like this:
$WADbSearch1->addComparisonFrom("specialtiesID","". $_GET["specialtiesID"]. ",","OR","Begins With",0);
$WADbSearch1->addComparisonFrom("specialtiesID",",". $_GET["specialtiesID"]. "","OR","Ends With",0);
$WADbSearch1->addComparisonFrom("specialtiesID",",". $_GET["specialtiesID"]. ",","OR","Includes",0);
$WADbSearch1->addComparisonFromEdit("specialtiesID","specialtiesID","OR","=",0);
Another solution that could work is to create a View in your database with something like:
SELECT Column1, Column2, etc, Concat(',',specialtiesID,',') AS specialtiesWrapped FROM Table
Then you would be able to use just this comparison:
$WADbSearch1->addComparisonFrom("specialtiesID",",". $_GET["specialtiesID"]. ",","OR","Includes",0);
You probably don't want to hear this part, but the reality is that you probably shouldn't be storing the values comma separated to begin with. Those should probably be separate rows in a relational table design particularly if you are searching against them. Storing numbers comma separated in a varchar field is not an efficient solution and wouldn't be suggested in the first place.