mdvignesh Posted March 20, 2012 Share Posted March 20, 2012 i want to make a monthly report the user selects month from drop down and i must get the specified dates of that month from the DB I am using ajax to get the dates 17827_.php 17828_.php Quote Link to comment https://forums.phpfreaks.com/topic/259329-select-a-month-details-from-mysql/ Share on other sites More sharing options...
Gem Posted March 20, 2012 Share Posted March 20, 2012 <?php $cnn = mysql_connect("localhost","root",""); mysql_select_db("hms",$cnn); $month=$_GET['q']; $html = "<strong>$month</strong> Month Report"; //$string="2004-12-28"; $result=mysql_query("SELECT monthname(date) As newd FROM stock_entries WHERE monthname(date)='".$month."' "); if(!$result) die(mysql_error()); $html .= "<table border='1'>"; while($row = mysql_fetch_array($result)) { $html.= "<tr>"; // echo "<td>" . date("m",strtotime($row['date'])) . "</td>"; $html .= "<td>" . $row['newd'] . "</td>"; //echo "<td>" . $row[''] . "</td>"; //echo "<td>" . $row[''] . "</td>"; //echo "<td>" . $row[''] . "</td>"; $html .= "</tr>"; } $html .= "</table>"; echo $html; ?> Quote Link to comment https://forums.phpfreaks.com/topic/259329-select-a-month-details-from-mysql/#findComment-1329387 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.