Hi,
I'm trying to create a drop down that has a number of variables using a while loop and a session variable.
Fields concerned are;
Member_id - a person's uniques number
Member_type - an array of y's & n's according to how they answered a question e.g. Y,n,n,n,n
Country_id - which country they reside in.
Using member_type in a session I try and create a drop down list of countrys that other people (of the same type) are residing in using this code;
$countries_array = array();
$countries = mh_db_query("select c.countries_name, c.countries_id from " . TABLE_PROPERTY . " p, " . TABLE_DISABILITY . " d, " . TABLE_COUNTRIES . " c where p.property_country_id = c.countries_id and c.countries_continent = '1' and d.members_id = p.members_id and d.members_array = '" . $member_type . "' group by c.countries_name");
while ($countries_values = mh_db_fetch_array($countries)) {
$countries_array[] = array('countries_id' => $countries_values['countries_id'],
'countries_name' => $countries_values['countries_name']);
}
return $countries_array;
}
This returns nothing, however replacing the session '" . $member_type . "' with it's value 'y,n,n,n,n' returns a list of countries. I have checked that $member_type is set correctly which it is, it works further down the page in a standard query perfectly well.
Is there some reason why it won't work in a while loop?
Please save my brick wall for further dents!:eek:
Cheers
Clint