i want to display last 3 months of data. but this query is not working. it showing empty results.
please some one help me.
$sql8 = mysql_query("SELECT `orderlist_id`, `brandname`, `packsize`, `quantity`, `mrp`, `ourRate`, `Sum`,user_id,userName,date FROM `orderlist` WHERE `user_id`='$userid' AND `userName`='$usern' AND date=DATE(NOW()) - INTERVAL 3 MONTH");
$i=0;
while($row8 = mysql_fetch_array($sql8))
{
$no = $row8['orderlist_id'];
$i++;
echo '<tr bordercolorlight="#B0A982"><td>'.$i.'</td><td>'.$row8["brandname"].'</td>';
if($_GET['orderid'] == $no)
{
echo '<td><form name="orderquantity" method="post" action="changequantity.php?id='.$_GET['orderid'].'"><input type="text" size="10" name="change_quantity" value="'.$row8["quantity"].'">
<input type="hidden" name="price" value="'.$row8["ourRate"].'">
<input type="submit" name="ch_quantity" value="Update"></form></td>';
}
else
{
echo '<td>'.$row8["quantity"].'</td>';
}
echo '<td>'.$row8["packsize"].'</td><td>Rs. '.$row8["mrp"].' </td><td>Rs. '.$row8["ourRate"].'</td><td>Rs. '.$row8["Sum"].'</td></tr>';