[eluser]ranjitbd[/eluser]
// this is a controller name holiday.php
function search_holiday()
{
$data = array();
$data[‘view_pack’] = $this->holiday->view_package();
echo “”;
print_r($data[‘view_pack’]);
// here i want to get the array value? which is sent by holiday_model.
}
// this is the model name holiday_model.php
function view_package()
{
$sql = “select * from theme_name”;
$query[‘theme’] = $this->db->query($sql);
$sql2 = “select * from destination”;
$query[‘destination’] = $this->db->query($sql2);
return $query->result_array();
// why this line not working ? produce the following errors
//Fatal error: Call to a member function result_array() on a non-object
// so how can i sent $query to controller….
// return $query; // this line does not shows any error.but when i print
// from the controller through this line print_r($data[‘view_pack’]); it does not print // the table value.it prints.
/*
Array
( [theme] => CI_DB_mysql_result Object
(
[conn_id] => Resource id #36
[result_id] => Resource id #60
[result_array] => Array
(
)
[result_object] => Array
(
)
[current_row] => 0
[num_rows] => 0
)
[destination] => CI_DB_mysql_result Object
(
[conn_id] => Resource id #36
[result_id] => Resource id #63
[result_array] => Array
(
)
[result_object] => Array
(
)
[current_row] => 0
[num_rows] => 0
)
)
*/
// i want to see here data from theme_name table and destination table...
}