Ok,
just to make sure, TYPE contains e.g. book,dvd,mag and not (book,dvd,mag)
That makes a difference in the following code (shortened):
<?PHP
$word = 'book';
$type = 'book,mag,dvd';
// $type = $row['TYPE'];
if (preg_match("ยง(^|,)$word(,|$)ยงi",$type)) {
echo "$word found";
}
// or something like this if you want to search
// for more than word
if (preg_match_all("ยง(^|,)(book|dvd|mag)(,|$)ยงi",$type,$matches)) {
// print array with matching strings
// $matches[2] contains the words found
print_r($matches);
}
?>