Selected Month

Hi,

I have new problem and i need some help with you guys.why i could not display the month to be selected.

this is my code



<select name="month">
				   <option value=""></option>
					<option value="1"
					 <?php
					    if($month==1)
						 {echo 'selected="selected"';}
					 ?>
					>January</option>
					<option value="2"
					<?php
					    if ($month==2)
						 {echo 'selected="selected"';}
					 ?>
					
					>February</option>
					<option value="3"
					<?php
					    if ($month==3)
						 {echo 'selected="selected"';}
					 ?>
					>March</option>
					<option value="4"
					<?php
					    if ($month==4)
						 {echo 'selected="selected"';}
					 ?>
					>April</option>
					<option value="5"
					<?php
					    if ($month==5)
						 {echo 'selected="selected"';}
					 ?>
					
					>May</option>
					<option value="6"
					<?php
					    if ($month==6)
						 {echo 'selected="selected"';}
					 ?>
					
					>June</option>
					
                                       .......
                                       ......
                                 </select>

This is how i select the table.



 if(isset($_GET['idno']))
   {
         $idno = $_GET['idno'];
	 $dosel="SELECT * from MYtable where ID = $idno";
	
	 $res = mysql_query($dosel);
	
	
	   while($row = mysql_fetch_array($res))
	    {
		  $idno = $row["ID"];
		  ......
                  ........
                  ........
		  $month=date('F',strtotime($row["BIRTH"]));
		
	   }
  }



date(‘F’, …) means that the value of month will not be 1, 2, 3 etc. It will be “January”, “Feburary” etc.

You can either change date(‘F’, … ) to date(‘n’, … ), or change your if statements.

Hi,Thank you for the reply…okay i will try this one.

Hi it’s working…thank you so much.