Hi All,

I'm stuck again on a dropdown list. Basically I have a list of websites to publish to in a CMS system that is called in via a function I created here:


PHP Code:
function get_possible_sites() { 
     
init_connect();
     global 
$siteAbb$share_one$share_two$share_country$share_uk$share_group;
     
$query="SELECT * FROM tbl where siteAbb = '$siteAbb'"
    
$result=mysql_query($query); 
    if(
FALSE==$result
        return 
FALSE;
    if((
|| FALSE)==mysql_num_rows($result)) { 
        return 
false
    } else { 
        
$result=db_result_to_array($result); 
        return 
$result
    } 

Now I want the function to pull in the following pre-defined global variables


$share_one, $share_two, $share_country, $share_uk, $share_group


and also the result of the query

$sites['site_id']

and then if any of the above values in the function are empty don't include them in the list

PHP Code:
     <?php 
foreach ($type_array as $sites
           { 
      if (empty(
$sites))
      {
            continue;
      }
              print(
"<option value=\"".$sites['site_id']."\"" . ($site_id == $sites['site_id'] ? 'selected="selected"' '') . "> ".$sites['name']."</option>
                     <option value=\""
.$share_one."\"" . ($site_id == $share_one 'selected="selected"' '') . "> ".$share_one_name."</option>
                     <option value=\""
.$share_two."\"" . ($site_id == $share_two 'selected="selected"' '') . "> ".$share_two_name."</option>
                     <option value=\""
.$share_country."\"" . ($site_id == $share_country 'selected="selected"' '') . "> ".$share_country_name."</option>
                     <option value=\""
.$share_uk."\"" . ($site_id == $share_uk 'selected="selected"' '') . "> ".$share_uk_name."</option>
                     <option value=\""
.$share_group."\"" . ($site_id == $share_group 'selected="selected"' '') . "> ".$share_group_name."</option>\n"); 
                     
           }  
        
?>
I think i'm close, but can anyone help?