06-07-2009, 11:58 AM
|
#1 (permalink)
|
|
The Wanderer
Join Date: Apr 2009
Posts: 19
Thanks: 9
|
Dynamic drop-down help!!
<form action="stud_attendance_report_month.php" name="select_date" method="POST">
<select name = "month" >
<option value = "0">Select one</option>
<?php
$query2 = mysql_query("SELECT * FROM attendance WHERE Stud_ID = '1'");
$numrows2 = mysql_num_rows($query2);
if ($numrows2!=0)
{
$row2 = mysql_fetch_assoc($query2);
$thing = $row2['att_date'];
$get_rows = mysql_query("SELECT att_date FROM attendance");
$month_rows = mysql_query("SELECT MONTHNAME('".$thing."') FROM attendance");
$set_month_name = date("M",strtotime(".$thing."));
$set_month_value = date("m",strtotime(".$thing."));
$assis_count = mysql_num_rows($get_rows);
$month_count = mysql_num_rows($month_rows);
?>
<option value ="<?php echo $set_month_value;?>"><?php echo $month_name." - ".$load_year; ?></option>
<?php
}
?>
</select>
There are 3 month names added Apr,May,Jun in the table of attendance, but in the drop-down there is only May that is displayed but not the actual names that are available in the database, help me..
__________________
--
Regards
Shankar
|
|
|
|