MySQL Query

I require a specialized query to be written...

Here is the form...

<form id="form" action="[url removed, login to view]" method="post">


echo '<h3>Genders:</h3>';

$query = "SELECT Gender FROM Genders";

$result = mysql_query($query);

while ($row = mysql_fetch_assoc($result))


echo '<input type="checkbox" name="Gender[]" value="' . $row['Gender'] . '" /> ' . $row['Gender'] . '<br />';


echo '<h3>Fetishes:</h3>';

$query = "SELECT Fetish FROM Fetishes";

$result = mysql_query($query);

while ($row = mysql_fetch_assoc($result))


echo '<input type="checkbox" name="Fetish[]" value="' . $row['Fetish'] . '" /> ' . $row['Fetish'] . '<br />';



<input id="Search" name="Search" type="submit" value="Search" />


Here is the query...

if (isset($_POST['Search']))


$GenderMatches = "'" . implode("','", $_POST['Gender']) . "'";

$ResultingMemberIDs = array();

$query = "SELECT MemberID FROM Members WHERE EmailVerified = 'Yes' AND MemberGender IN ( $GenderMatches )";

$result = mysql_query($query);

while ($row = mysql_fetch_assoc($result))


$subquery = "SELECT MemberID FROM MemberFetishes WHERE MemberID = '{$row['MemberID']}' AND ((Fetish == ??? ... This is where I need the help))";

$subresult = mysql_query($subquery);

while ($subrow = mysql_fetch_assoc($subresult))


$ResultingMemberIDs[] += $subrow['MemberID'];




The problem is that I need it to provide me with results that match ALL of the submitted Fetishes, not results where a Member has only 1 or some of the submitted Fetishes...

I need this rather quickly, so please only reply if you can accomplish this quickly for me...

Kemahiran: MySQL, PHP

Lihat lagi: n query, match problem, mysql query, mysql index, array form, form array, php post array, php search mysql row, mysql member, php form post array, php value post, php form array post, query query, mysql query php, implode mysql, search query, search results checkbox php mysql, checkbox php mysql search, search checkbox mysql php, mysql problem, mysql php input, post mysql, form post action, select form select mysql, mysql php checkbox

Tentang Majikan:
( 9 ulasan ) Pevely, United States

ID Projek: #1568497

Dianugerahkan kepada:


Expert here..simple task..I can help!

$30 USD dalam 0 hari
(120 Ulasan)

4 pekerja bebas membida secara purata $36 untuk pekerjaan ini


Hello, we're team of professionals. We got the fix for you!

$30 USD dalam 0 hari
(25 Ulasan)

Hi, I'm interested taking this job, this is really a quick fix :) Talk to you soon. Best regards, Aty

$35 USD dalam sehari
(7 Ulasan)

Hello, I can provide you the solution. Can we discuss the problem? Message me if agree. Thanks

$50 USD dalam sehari
(0 Ulasan)