Jump to content

select a month details from mysql


mdvignesh

Recommended Posts

<?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;
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.