Welcome Guest, Not a member yet? Register   Sign In
Question about calendar and database
#1

[eluser]Mef[/eluser]
Hi,

I've got table with events in my database, where every event has date and time in DATETIME format.

What I'm trying to do, is to write a loop, to automatically fill CI's calendar array from db.

This is how it looks static:

Code:
$eventy = array(
               '2009' => array(
                    '02' => array(
                            6  => base_url().'repertuar/koncert/1',
                            7  => base_url().'repertuar/koncert/2',
                            13 => base_url().'repertuar/koncert/3',
                            20 => base_url().'repertuar/koncert/4',
                            21 => base_url().'repertuar/koncert/5',
                            27 => base_url().'repertuar/koncert/6'
                            ),
                    '03' => array(
                            6  => base_url().'repertuar/koncert/7',
                            7  => base_url().'repertuar/koncert/8',
                            13 => base_url().'repertuar/koncert/9',
                            20 => base_url().'repertuar/koncert/10',
                            27 => base_url().'repertuar/koncert/11',
                            28 => base_url().'repertuar/koncert/12'
                            ),
                    '04' => array(
                            3  => base_url().'repertuar/koncert/13',
                            5  => base_url().'repertuar/koncert/14',
                            17 => base_url().'repertuar/koncert/15',
                            24 => base_url().'repertuar/koncert/16'
                            ),
                    '05' => array(
                            8 => base_url().'repertuar/koncert/19',
                            15 => base_url().'repertuar/koncert/20',
                            22 => base_url().'repertuar/koncert/21',
                            23 => base_url().'repertuar/koncert/22',
                            29 => base_url().'repertuar/koncert/23',
                            30 => base_url().'repertuar/koncert/24'
                            ),
                    '06' => array(
                            5  => base_url().'repertuar/koncert/25',
                            13 => base_url().'repertuar/koncert/26',
                            19 => base_url().'repertuar/koncert/27'
                            )
                    )
                );

So basically I assume I need to pull out month and day from DATETIME field, create a loop and change static months, days and IDs to dynamic ones, but I have no idea how to achieve this. Any help will be appreciated.


Messages In This Thread
Question about calendar and database - by El Forum - 05-05-2009, 12:59 AM
Question about calendar and database - by El Forum - 05-05-2009, 01:41 AM
Question about calendar and database - by El Forum - 05-05-2009, 02:04 AM
Question about calendar and database - by El Forum - 05-05-2009, 03:00 AM
Question about calendar and database - by El Forum - 05-05-2009, 06:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB