So, I am asking for help from the community. I have tried for days to fix this, but couldn't.
It's either a logical or a code issue or both. It fills up my error log with "Undefined index at line ..."
Any help is most welcome.
Many thanks in advance.
Sara
<?php
$select_zones_query = tep_db_query("SELECT c.countries_id, c.countries_iso_code_2, z.zone_name FROM countries c, zones z WHERE c.countries_id = z.zone_country_id ORDER BY z.zone_country_id, z.zone_name");
while ($zone_option = tep_db_fetch_array($select_zones_query)) {
$country_with_zone_code = $zone_option['countries_iso_code_2'];
// if this is the first time that we've seen this country,
if ( !is_array($zones_array[$country_with_zone_code]) ) { // <---------Undefined index: AT, CA, DE etc.
echo $country_with_zone_code; // Gives ATCADEESSECHUS ... a list of country codes
// initialize an array for it with a blank default value
$zones_array[$country_with_zone_code]
= array(array('id' => '',
'text' => PLEASE_SELECT_A_STATE));
// save the country code to id mapping for use with the javascript later
$country_id_for[$country_with_zone_code] = $zone_option['countries_id'];
}
$zones_array[$country_with_zone_code][] = array('id' => $zone_option['zone_name'],
'text' => $zone_option['zone_name']);
}
?>










