imrankhan Posted March 6, 2010 Share Posted March 6, 2010 Hi, 1st of all thnx to darghon which make it so simple and easy the output for the below code is like: Date Tenders 2009-03-08 35 2009-03-09 0 2009-03-10 14 2009-03-11 27 Now i want List Box which is embedded in code work with the page to display the record month wise and year wise which user select code below is in 100% working expect list box function Thanks in advance. Regards, imran Here is the Code <? $username="******"; $password="******"; $database="*******"; mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); ?> <select name="listmonth"> <option value="1">January</option> <option value="2">February</option> <option value="3">March</option> <option value="4">April</option> <option value="5">May</option> <option value="6">June</option> <option value="7">July</option> <option value="8">August</option> <option value="9">September</option> <option value="10">October</option> <option value="11">November</option> <option value="12">December</option> </select> <select name="listyear"> <option value="2009">2009</option> <option value="2010">2010</option> </select> <br /><br /> <table width="305"> <tr><th>Date</th><th>Tenders</th></tr> <?php $query="select distinct advertise_date, count(tender_title) as tenders from ppra_tenders group by advertise_date order by advertise_date asc"; $result = mysql_query($query); if(mysql_num_rows($result) > 0){ while($row = mysql_fetch_array($result)){ ?> <tr><td><?php echo $row["advertise_date"]; ?></td><td><?php echo $row["tenders"]; ?></td></tr> <?php } } mysql_free_result($result); ?> </table> Link to comment https://forums.phpfreaks.com/topic/194320-connect-listbox-with-code-or-combo-box-with-code/ Share on other sites More sharing options...
imrankhan Posted March 6, 2010 Author Share Posted March 6, 2010 in above code i forget to add submit button after list box <input type="submit" value="submit"/> Link to comment https://forums.phpfreaks.com/topic/194320-connect-listbox-with-code-or-combo-box-with-code/#findComment-1022249 Share on other sites More sharing options...
imrankhan Posted March 11, 2010 Author Share Posted March 11, 2010 no one is here to help ? where r u darghon? Link to comment https://forums.phpfreaks.com/topic/194320-connect-listbox-with-code-or-combo-box-with-code/#findComment-1024642 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.