showing a date of entry of the Recordset, how to fill out the dates does not appear?

I've been several different directions on it, but it can work.

I'm trying to list a date range as Nov 1-8 November, that is to say Nov1, 2, Nov3, etc., under each date show a COUNTY recordset for this date and if there is no record for this date, indicates 0.

I have this sql

mysql_select_db($database_connbubba, $connbubba);
$query_rs_count = "SELECT yard_sales.yardsale_date,DATE_FORMAT(yard_sales.yardsale_date, '%b %d') AS theDate,COUNT(*) FROM yard_sales WHERE yard_sales.yardsale_date>=CURDATE() GROUP BY yard_sales.yardsale_date";
$query_limit_rs_count = sprintf("%s LIMIT %d, %d", $query_rs_count, $startRow_rs_count, $maxRows_rs_count);
$rs_count = mysql_query($query_limit_rs_count, $connbubba) or die(mysql_error());
$row_rs_count = mysql_fetch_assoc($rs_count);


user publishes their yard sales information in the db and the yardsale_date column is date YYYY-MM-DD

with this configuration, so I have a table with 2 lines (rs_count.theDate and rs_count. COUNT) and the table is repeated horizontally.

so the result is

2 Nov6 Nov8

1 yard Sale 2 Yard Sale 1 Yard Sale

How can I get

Nov2                 Nov3                   Nov4                 Nov5                   Nov6                      Nov7                  Nov8

1 yard Sale 0 Yard Sales 0 Yard Sales 0 Yard sale Yard Sales 0 Yard Sale 1 Yard Sale 2

Thanks for your help,

Jim balthrop

You cannot display the data that do not exist, so you must first create another calendar table which includes all the possible dates. You can then join this table to your main table. Pull on the dates of the calendar table and count the number of sales in your main table. To group the dates table.

Tags: Dreamweaver

Similar Questions

Maybe you are looking for