Re: How make the time
| From: | David Tandberg-Johansen | Date: | Wed, 18 Jul 2001 10:40:32 +0000 |
| Subject: | Re: How make the time | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-58423@lists.php.net to get a copy of this message | ||
Thank you
"Elias" <elias_bachaalany@yahoo.com> skrev i melding
news:20010718074448.15790.qmail@pb1.pair.com...
>
> select count(*) from test1
> where
> MINUTE(tm1) >= 15
> and
> MINUTE(tm1) <= 30
> and
> HOUR(tm1)=12
>
> this query will return you on column containing how many record found in
> that time range, same as how many customers where surfed at that time
> where 30-15=interval
> and 12 is the hour you're checking in!
>
> "David Tandberg-Johansen" <david@datajo.no> wrote in message
> news:20010717233605.94548.qmail@pb1.pair.com...
> > Hello!
> >
> > I am trying to make an online booking script for a client (restaurant),
> and
> > I am using MySQL to store the booking information
> > The restaurant have openings hour from 11:00 -> 01:00, but do only take
> > reservation between 11:00->22:30.
> > The client wants to get a report written out over each hour like this:
> >
> > 11:00 2 Customers
> > 11:15 32 Customers
> > 11:30 12 Customers
> > ...
> > ...
> > 22:30 14 Customers
> >
> > In the MySQL table I have set up the time field as 'time' with 00:00:00
as
> > default.
> >
> > Everything is ok, but I am stuck on how to make this report. The
customer
> > have set an interval of 15 mnutes between possible time to book, so I
have
> > to make an 'SELECT'-query based on when the restaurant opens to the time
> of
> > the last possible booking time. But how do I make the timeset (11:00:00
> and
> > up to 22:30:00)
> >
> > My far out example:
> > interval = 15;
> > while (time<=endtime){
> > time=starttime
> > DBCONNECTION
> > Select * from booking wher tine_field='time'
> > time = time+interval
> > }
> >
> > Do anyone have any tips on how I can solve this
> >
> > David
> >
> >
>
>
>
>