How to get rid of error: `Undefined offset: 1 on line 20`? I know it occurs becaouse Im calling array that's offset simply does not exist. 

Silecing it wiht @ just doesnt seem right at all.

```
//create an array with all x, y
for ($x = 1; $x <= 5; $x++) $array_x[] = $x;
for ($y = 1; $y <= 5; $y++) $array_y[] = $y;

$IN_x = "'" . implode("', '", $array_x) . "'";
$IN_y = "'" . implode("', '", $array_y) . "'";

$pullMapInfo = "SELECT x, y, value FROM mapinfo WHERE id='{$id}' AND x IN ({$IN_x}) AND y IN ({$IN_y})";
$pullMapInfo2 = mysql_query($pullMapInfo) or die('error here');

//create an associative array x, y => value
while ($pullMapInfo3 = mysql_fetch_assoc($pullMapInfo2)) {
    $result[ $pullMapInfo3['x'] ][ $pullMapInfo3['y'] ] = $pullMapInfo3['value'];
}

//loop to display output
foreach ($array_x as $x) {
foreach ($array_y as $y) {
    if (array_key_exists($x, $result) && array_key_exists($y, $result)) {
        echo '<div class="castle_array" id="'.$x,'x',$y.'">'. $result[$x][$y] .'</div>
                ';
    } else {
        echo '<div class="castle_array" id="'.$x,'x',$y.'"></div>
                ';
    }
}
}

```

2 for loops seems awkard