View Single Post
Old 05-11-2009, 04:11 AM   #2 (permalink)
foobarph
The Wanderer
 
foobarph's Avatar
 
Join Date: May 2009
Posts: 23
Thanks: 4
foobarph is on a distinguished road
Default

you did not used FOR statement, of course it will not display anything.

Code:
<form action="stud_attendance_report_month.php" name="select_date" method="POST">

View results of &nbsp;&nbsp;&nbsp;

<select name = "month" >

<?php

include("connect.php");

$query = mysql_query("SELECT * FROM stud_attendance WHERE username = 'srikant'");
$numrows = mysql_num_rows($query);

if ($numrows!=0) {
	$row = mysql_fetch_assoc($query);
	$id = $row['stud_id'];
	$thing = $row['date'];
	$set_month = mysql_query("SELECT MONTHNAME('".$thing."') FROM stud_attendance");
	$set_month_value = mysql_query("SELECT MONTH('".$thing."') FROM stud_attendance");
	
	for ($i=0;$i<=10;$i++) {
	
	?>
		<option value ="<?php echo $set_month_value;?>"><?php echo $set_month; ?></option>
<?php
	}
} ?>

</select>

&nbsp;&nbsp;&nbsp;

<input id='button' type='submit' name='select_date' value='Submit' />
</form>
I hope you will get some insight from this. :)
foobarph is offline  
Reply With Quote