I have developed a website with a user profile page with eye_colour , hair_colour , size etc. Each item has a set range of values entered through a drop down list. I wish to allow the users to search these set range’s to find their ideal match. To this end I have a search form set up and a number of SELECT statements feeding to array seach using the tuple user. i.e.
<?php
$var1 = SELECT ‘user’ FROM ‘profile’ WHERE ‘hair_colour’ = $hair;
$var2 = SELECT ‘user’ FROM ‘profile’ WHERE ‘eye_colour’ = $eye;
$var3………4………..5………..n etcc
?>
I think there is a function which allows all the arrays to be taken in and unioned ALL together, then sorted/weighted by the most occurances of the user and all items can then be displayed. Does anyone know if such a php function exists and if it does what its name is? I could try the SQL if such a function doesn’t exist but I’d definitely make a few mistakes!! Thanks for any help!
WHERE hair_color = '$hair' OR eye_colour = '$eye' OR ....and so on. There is absolutely no need for a UNION query for such a simplistic situation.should have used these I believe. Thanks for the solution guys