I want to show the records from database daywise from start dat to end date...the records has date which is inserted to the database at the record insertion time...the records are not stored daily so there must be a gap between two dates record. So now I want to show the records daywise that is if the perticular date has no records i want to show 0 instead of it.
I am able to show the records which date is stored in database. But cant show the records which date are not available in the database.
>$res=mysql_query("SELECT DISTINCT Date FROM TABLE_NAME WHERE Date BETWEEN startdate AND enddate");
>while($row = mysql_fetch_array($res))
>{
> $date[] .= $row['Date'];
>}
>
>foreach($date as $da)
>{
> $query = "SELECT * FROM TABLE_NAME WHERE Date = '".$da."' ";
> $result = mysql_query($query);
> while($row = mysql_fetch_array($result))
> {
> $prod = $row['No_of_prod'];
> }
> echo $prod;
>}