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
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 06-07-2009, 11:58 AM   #1 (permalink)
The Wanderer
 
Join Date: Apr 2009
Posts: 19
Thanks: 9
shankar is on a distinguished road
Default 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
shankar is offline  
Reply With Quote
 



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
Removing Search Results from drop down Kay1021 General 28 05-12-2009 03:59 PM
Jesus help me dynamic update in drop down shankar General 1 05-11-2009 04:11 AM
Jesus help me dynamic update in drop down shankar Advanced PHP Programming 3 05-08-2009 08:12 PM
Drop down relationship to SQL? xxtokerxx Absolute Beginners 1 05-05-2009 08:32 PM
Load url on select, via drop down menu h0ly lag XHTML, HTML, CSS 2 10-03-2008 05:39 AM


All times are GMT. The time now is 04:03 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