I have this code to load the month of the birthday that corresponds to the id number:
<
?php $query = "SELECT DISTINCT BIRTHDAY FROM student WHERE IDNO='".$_GET['id']."'";
if($result = mysql_query($query)) {
if($success = mysql_num_rows($result) > 0) {
?>
<select title="- Select Month -" name="mm" id="mm" class="" >
while ($row = mysql_fetch_array($result))
list($year,$month,$day)=explode("-", $row['BIRTHDAY']);
?>
<option value="<?php echo $month;?>"><?php echo $month; ?></option>\n";
And this is the form action:
$birthday = mysql_real_escape_string($_POST['mm']);
mysql_query("UPDATE student SET YEAR = FIRSTNAME='$fname', BIRTHDAY='$birthday'
WHERE IDNO ='$idnum'");
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