Hi, Is there a way to compare a mysql field x,y,z with array y,x,z It should check if the field has every character in the array Cheers
Maybe you could do something along these lines $array = array('x', 'y', 'z'); $query = "SELECT * FROM table"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result){ foreach ($array as $a){ while(charExist){ $charExist = strpos($row['field'], $a); if (charExist == true) $total ++; } if (total == sizeof($array)){ echo "all characters exist"; } } } PHP: