TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 05-08-2009, 07:23 PM   #1 (permalink)
The Wanderer
 
Join Date: Apr 2009
Posts: 19
Thanks: 9
shankar is on a distinguished road
Default Jesus help me dynamic update in drop down

<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");
}
?>
<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>


Am unable to get the output, it does not display any month name.
Can anybody help me, have to submit the project by evening.
__________________
--
Regards
Shankar
shankar is offline  
Reply With Quote
Old 05-11-2009, 04:11 AM   #2 (permalink)
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
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Jesus help me dynamic update in drop down shankar Advanced PHP Programming 3 05-08-2009 08:12 PM
mysql update with multi fields sarmenhb Absolute Beginners 1 02-06-2009 10:03 PM
Can you use IGNORE in the update of a mysql row ? codefreek General 5 11-17-2008 12:45 AM
You are subscribed to this thread mysql update with multi fields sarmenhb Advanced PHP Programming 0 11-15-2008 05:00 AM
mysql update with multi fields sarmenhb General 0 11-15-2008 04:19 AM


All times are GMT. The time now is 06:57 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design