I'm a total newbie, and I'm trying to do something similar to Scott.

I created a table in the database called destinations made of columns country and city, and used autocomplete CCK to create a group location made of fields country (field_country) and city (field_city).

I added the following code in the PHP code field of country to select all countries in table destinations, and it correctly returns all countries found in the table

$sql = 'SELECT country FROM destinations';
$res = db_query($sql);
while($row = db_fetch_array($res))
{
$allwd_value = $row['country'];
$rows[$allwd_value] = $allwd_value;
}
return $rows;

But the following PHP code added to city doesn't return anything probably because variable $field_country doesn't exist, or doesn't have the value select in country.

$sql = 'SELECT city FROM destinations WHERE country LIKE "' . $field_country . '"';
$res = db_query($sql);
while($row = db_fetch_array($res))
{
$allwd_value = $row['city'];
$rows[$allwd_value] = $allwd_value;
}
return $rows;

Is there a variable holding the value select for country that I can use to select the city?

Thanks,

Andre