Results 1 to 5 of 5

Thread: loop with dates

  1. #1
    Join Date
    Jan 2005
    Posts
    362

    Unanswered: loop with dates

    I have a form with 2 dates.
    At the "post" php file, I want to make a loop betwen these dates.
    How can I do that?
    Dimis

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    sorry its not very clear what you want to do...

    perhaps you amplify what it is you need
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Jan 2005
    Posts
    362
    For example I have the dates 5/3/2009 and 26/3/2009, I have to loop from 5 to 26/3.
    Day 5/3,6/3,7/3,/8/3...26/3 with php.
    Dimis

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    pseudo code:
    Code:
    start_date = 2009-03-05
    end_date = 2009-03-26
    i = 0
    
    while start_date + i <= end_date
      show start_date + i
      i = i + 1
    loop
    George
    Home | Blog

  5. #5
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    what I meant was what do you want to use the loop for?
    are you using this to extrract dates from a table, if so a suitable where clause would make more sense

    eg
    select my,column,list from mytable
    where mydatecolumn between (startdate and enddate)
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •