0

A PHP Error was encountered
Severity: Notice
Message: Undefined index: id
Filename: controllers/event.php
Line Number: 215

function addParticipant() {
        $data['event_id'] = $this->input->get('id', TRUE);
        $event_detail = $this->EventModel->getEventDetail($this->input->get('id', TRUE));
        $data['event_title'] = $event_detail[1];
        $this->loadpage($data, 'people', 'Add participants | BCIPN');
    }
4
Contributors
8
Replies
32
Views
4 Years
Discussion Span
Last Post by cereal
0

the above code shows the error in the 4th line
$data['event_title'] = $event_detail[1];

0

If id is passed inplace of 1, the above error msg gets displayed. And if i pass 1 then the error msg will be like
A PHP Error was encountered
Severity: Notice
Message: Undefined index: 1
Filename: controllers/event.php
Line Number: 215

0

That means an empty array, so $event_detail[1] does not exist. You may need to do some checking to avoid the notice. It is caused by the fact that there is no event detail found for the id you passed (or id is empty too).

0

try this in your function.

echo '<pre>';

print_r($this->input->get(ALL));
or 
print_r($this->input->post(ALL));

die();
1

@szabizs

You don't need to add ALL to retrieve complete entries from those arrays, just:

print_r($this->input->get());

Same applies to post() method.

Votes + Comments
thanks :)
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.