![]() |
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.. |
Hi Shankar,
Seems you're missing the looping mechanism for inserting each month into the <option> tag? Jason |
Quote:
|
| All times are GMT. The time now is 02:49 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0