www.webdeveloper.com
Page 2 of 2 FirstFirst 12
Results 16 to 25 of 25

Thread: nested loop not working (need sort by date)

  1. #16
    Join Date
    Sep 2010
    Posts
    38
    Hi,
    I do not know how to do that

    PHP Code:
    set your check date variable as null
    loop here
    is check date the same
    ?
    yes, continue existing table
    no
    start a new table
    set check date variable to current field value
    end loop 
    I know there is a if statement in there, but how do I check if the value.
    I am a newbie in the world of php and mysql.
    Last edited by catalepticstate; 10-05-2010 at 05:16 AM.

  2. #17
    Join Date
    Sep 2010
    Posts
    38
    so will

    $row['date'] = NULL
    if $row['date'] = $row['date'] {
    Output table
    }
    else if $row['date'] = $row['date'] {
    Output table
    }

    The problem with that is, its saying the same thing.

    So if the date for first block is 2010-01-01 the matches with that date are the same then output table

    but will I need a counter to move the date check up to the next one?

  3. #18
    Join Date
    Jan 2009
    Posts
    3,346
    So you would need to create a new variable. Then during your loop check if that variable is the same as your field value. I'm afraid I won't be much help without doing it for you until to grasp some of the basics. Try looking at some of the following tutorials to see if that helps. If you get rolling and get stuck again post back what you have coded and where you need help and I'm sure someone will be able to point you in the right direction.

    http://www.w3schools.com/php/default.asp
    http://php.net/manual/en/tutorial.php
    http://www.tizag.com/phpT/

  4. #19
    Join Date
    Sep 2010
    Posts
    38
    Could you do it for me? I am not very confidant in doing this or give me a basic code and I could develop on that

  5. #20
    Join Date
    Jan 2009
    Posts
    3,346
    I don't mind helping guide someone towards the answer or assisting on a conceptual level...however, this is my "day job" so I don't generally like to do it for free. Sorry.

  6. #21
    Join Date
    Sep 2010
    Posts
    38
    :'(

  7. #22
    Join Date
    Jan 2009
    Posts
    3,346
    You could always hire a freelancer if you don't want to take the time to learn to do it yourself.

  8. #23
    Join Date
    Sep 2010
    Posts
    38
    I have hired someone, but he has not got back to me with this. I dont know what to do.

  9. #24
    Join Date
    Jan 2009
    Posts
    3,346
    HR issues are something I really can't help you with. Maybe check that your contract allows you to refute payment if an adequate solution is not presented.

  10. #25
    Join Date
    Sep 2010
    Posts
    38
    Hi,
    The developer got back to me and fixed the issue.

    He says it was the for loop that needed fixing, he did not touch the queries.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles