Afficher un message
Vieux 05/10/2007, 09h34   #4
Captain Paralytic
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Find next available slot in Calendar

On 5 Oct, 09:00, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote:
> On Fri, 05 Oct 2007 06:58:22 +0200, subtenante <zzsubtenant...@gmail.com>
> wrote:
>
>
>
>
>
> > On Tue, 02 Oct 2007 18:02:58 -0700, ½aßrain <mccb...@gmail.com> wrote:

>
> >> Hi Guys,

>
> >> I have a table of events with a start and finish datetime.

>
> >> I am trying to write a php function that will return the next earliest
> >> start time that an event will fit. Will this be something that I can
> >> do just in mysql?

>
> >> or something much more complex?

>
> >> anyone have any tips?

>
> > SELECT * FROM mytable
> > WHERE start > NOW()
> > ORDER BY start
> > LIMIT 1

>
> That's for the next event indeed. I gathered the OP meant 'next empty
> slot'. In which case these 'slots' should either have a table or the OP
> should tell us more about them.
> --
> Rik Wasmus- Hide quoted text -
>
> - Show quoted text -


I think he was quite clear (but maybe I'm reading it wrong). All his
events have a start datetime and an end datetime. When he wants to add
a new event, this will have a duration and he wants to find an
unfilled gap in events that will take this duration without
overlapping.

  Réponse avec citation
 
Page generated in 0,20410 seconds with 9 queries