My experience is a bit limited with php and sql but I'm getting the hang of it. If I want to select an entry from a database based on values in multiple entries then I'm using the following code:
$query="SELECT * FROM wp_bp_xprofile_data WHERE field_id='4' AND user_id='1'";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
echo "<b><center>Database Output</center></b><br>";
$i=0;
while ($i<$num) {
$first=mysql_result($result,$i,"value");
echo "<b>$first</b><br>";
$i++;
}
In the above scenario my criteria are both fixed values. However, I'd like to be able to set my criteria to whenever field_id='4' AND value="the entry Handyman within the array". The array is throwing me off since I'd just like to make anytime Handyman shows up a criteria.
if criteria met THEN display
the value contents when field_id='4' AND user_id = the correlating number from any of the rows that meet the criteria above.
The attached image shows the table. So basically whenever handyman shows up for a user (among other possibilities in the array) then it will display the correlating name of that person. Example in image would be user_id=3. Handyman is included in the value field so it should display Noel.
Like i said I'm new to it but I'm picking things up. The array is throwing me off a bit on how to handle here.
Thank you in advanced. Any help is appreciated. [ATTACH]4907[/ATTACH]