Dave --

...and then Dave G said...
% 
...
%       My problem is that I can't figure out how to compare the results
% of the query to the dates on the calendar so that they display on the
% right dates.

OK.


%       I thought I should put those date in an array and then on each
% date, search that array for a matching date, and if it's found, then

Generally when working with a database you want to avoid sucking in the
entire result set and working on it, since it could be huge.  It's much
better to walk down it one row at a time -- and hence mysql_fetch_array()
and friends.

What I'd do in your situation is do my select based on whatever criteria
you might use and also be sure to order by the date and then just loop
through your calendar.  Pull an initial row and then start a loop which

  - picks a calendar date
  - checks to see if it matches the row
    - if it does, print it and pull the next one and repeat
    - if not, close the day and repeat

through your entire $display_period.


HTH & HAND

:-D
-- 
David T-G                      * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/      Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to