undefined offset 1 and 2 errors
<p>I am receiving these errors below:</p>

<pre><code>Notice: Undefined offset: 1 in ... on line 93 
Notice: Undefined offset: 2 in ... on line 94 
</code></pre>

<p>What does these errors mean and how can it be fixed? I can't see where the problem is but I know they are appearing after clicking on the "Module Submit" button</p>

<p>$moduleactive = 1;</p>

<pre><code>    $sql = "SELECT ModuleId, ModuleNo, ModuleName FROM Module WHERE ModuleActive = ? ORDER BY ModuleNo"; 


     $sqlstmt=$mysqli-&gt;prepare($sql);

     $sqlstmt-&gt;bind_param("i", $moduleactive);

     $sqlstmt-&gt;execute(); 

     $sqlstmt-&gt;bind_result($dbModuleId,$dbModuleNo,$dbModuleName);


    $moduleHTML  = "";  
      $moduleHTML .= '&lt;select name="modules" id="modulesDrop"&gt;'.PHP_EOL;
 $moduleHTML .= '&lt;option value=""&gt;Please Select&lt;/option&gt;'.PHP_EOL;  

     while($sqlstmt-&gt;fetch()) { 
         $moduleHTML .= sprintf('&lt;option value="%1$s_%2$s_%3$s"&gt;%1$s - %2$s&lt;/option&gt;'.PHP_EOL, $dbModuleNo, $dbModuleName, $dbModuleId);
    } 

$moduleHTML .= '&lt;/select&gt;'; 

    $pHTML = "";


    ?&gt;


&lt;form action="&lt;?php echo htmlentities($_SERVER['PHP_SELF']); ?&gt;" method="post" onsubmit="return validation(event);"&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;th&gt;Module: &lt;?php echo $moduleHTML; ?&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;&lt;input id="moduleSubmit" type="submit" value="Submit Module" name="moduleSubmit" /&gt;&lt;/p&gt;
&lt;div id="moduleAlert"&gt;&lt;/div&gt;
&lt;div id="targetdiv"&gt;&lt;/div&gt;
&lt;/form&gt;

&lt;?php

if (isset($_POST['moduleSubmit'])) {    

$outputmodule = ""; 

$moduleInfo = explode("_", $_POST['modules']);
$moduleNo = $moduleInfo[0];
$moduleName = $moduleInfo[1]; //Error line 93
$moduleId = $moduleInfo[2]; //Error line 94
$outputmodule = sprintf("&lt;p&gt;&lt;strong&gt;Selected Module:&lt;/strong&gt; %s - %s &lt;input type='hidden' value='%s'&gt;&lt;/p&gt;", $moduleNo, $moduleName, $moduleId);

}

?&gt;
</code></pre>
