Welcome Guest, Not a member yet? Register   Sign In
passing query result into calendar class?
#1

[eluser]jigen7[/eluser]
Hi everyone I cant seem to make this work, i got a function in the model where it returns the date of the query then store the sql result to an array $date_arr then pass that variable to the calendar just lyk in the User Guide but when i tried it,
the calendar only display the last query result of the date??can anyone help me here??thx

Model Code
Code:
function get_calendar_date($id,$month,$year){

     $sql = "Select Date FROM schedule WHERE resort_id = $id AND Month = $month AND Year = $year";
     $query = $this->db->query($sql);
    
     return $query;
    
    
    }

Controller Code
Code:
$query = $this->Reservations->get_calendar_date($id,$month,$year);
    
        $date_arr = array();
        foreach($query->result() as $row):
        $date_arr[$row->Date] =  $row->Date;
        endforeach;
        print_r($date_arr);
        $data['cal'] = $this->calendar->generate($year,$month,$date_arr);
        $this->load->view('calendar',$data);


Messages In This Thread
passing query result into calendar class? - by El Forum - 02-18-2008, 02:47 PM
passing query result into calendar class? - by El Forum - 02-19-2008, 11:58 AM
passing query result into calendar class? - by El Forum - 02-19-2008, 12:18 PM
passing query result into calendar class? - by El Forum - 02-19-2008, 12:20 PM
passing query result into calendar class? - by El Forum - 02-19-2008, 12:27 PM
passing query result into calendar class? - by El Forum - 02-19-2008, 12:29 PM
passing query result into calendar class? - by El Forum - 02-19-2008, 12:35 PM



Theme © iAndrew 2016 - Forum software by © MyBB