title: How to update mysql data when using explode
body: <p>I have this code to load the month of the birthday that corresponds to the id number:</p>
  
  <pre><code>&lt;?php 
      $query = "SELECT DISTINCT BIRTHDAY FROM student WHERE IDNO='".$_GET['id']."'";
      if($result = mysql_query($query))  
      {
          if($success = mysql_num_rows($result) &gt; 0) 
          {
  ?&gt;
  &lt;select title="- Select Month -" name="mm" id="mm" class="" &gt; 
  &lt;?php
  
      while ($row = mysql_fetch_array($result))
             list($year,$month,$day)=explode("-", $row['BIRTHDAY']);
  ?&gt; 
               &lt;option value="&lt;?php echo $month;?&gt;"&gt;&lt;?php echo $month; ?&gt;&lt;/option&gt;\n";
  </code></pre>
  
  <p>And this is the form action:</p>
  
  <pre><code>$birthday = mysql_real_escape_string($_POST['mm']); 
  
  mysql_query("UPDATE student SET YEAR = FIRSTNAME='$fname',  BIRTHDAY='$birthday'
  WHERE IDNO ='$idnum'");
  </code></pre>
  
  <p>What should I do, when I click on the update button, it executes, but I see the  undefined offset error is stored in  the mysql database and not the month.
  I'm just a beginner, can you give me some tips on how can I achieve updating the data </p>