Kod
$a="SELECT * FROM application (WHERE (sex='M' and c='1') ORDER BY distance DESC , situation DESC, pref1 ASC) ";
$b="(WHERE (sex='M' and d='1') ORDER BY distance DESC , pref1 ASC) ";
$result = mysql_query("".$a." AND ".$b)
$b="(WHERE (sex='M' and d='1') ORDER BY distance DESC , pref1 ASC) ";
$result = mysql_query("".$a." AND ".$b)