Welcome Guest, Not a member yet? Register   Sign In
Setting event using a date, not a day in every month?
#5

[eluser]stef569[/eluser]
Hi, I saw my errors and correct them,

1. I was overwriting my array (no that wasen't part of the plan :d)
2. I thought I got an aray when it was an object.
3. Input validation
4. Testing i didn't know about the print_r will look into it.

This works:
Code:
// Create array of days as key with content(userId)
    //@param $query db record object.
    function createEvents($query) {
         if ($query->num_rows() > 0) {
          foreach ($query->result() as $row) {
                $curDay = $row->event_Bday;
                while($curDay <= $row->event_EDay) {
                    echo 'Day: '.$curDay.' UserId: '.$row->user_id.'<br/>';
                    $events[$curDay++] = $row->user_id;
                }
            }
        } else {
            echo 'No Events for this month.';
        }
         return $events;
    }

Thx for the help once again, I realy learnt alot from your code examples
Mayby once I can help you out Smile so we are even again Wink


Messages In This Thread
Setting event using a date, not a day in every month? - by El Forum - 11-01-2007, 05:00 AM
Setting event using a date, not a day in every month? - by El Forum - 11-01-2007, 05:32 PM
Setting event using a date, not a day in every month? - by El Forum - 11-02-2007, 08:52 AM
Setting event using a date, not a day in every month? - by El Forum - 11-02-2007, 11:48 AM
Setting event using a date, not a day in every month? - by El Forum - 11-02-2007, 01:35 PM



Theme © iAndrew 2016 - Forum software by © MyBB