Muhammed A. Rdwan Muhammed A. Rdwan - 4 months ago 53
PHP Question

codeigniter flashdata works inside false if statement

i not new to codeigniter 2
but i wasn't using flashdata before and i started to use it today
i got strange issues
i'm creating if statment

$query = $this->db->get_where('blocks', array('block_id' => $id));
if($query->num_rows() < 1)
$this->session->set_flashdata(array('notify_type'=>'error', 'notify_msg'=>'some error msg'));
return false;
return $query->row();

the problem is ,
my model returns the query perfect
and also the flashdata triggers
i'm sure num_row is < 1 and if not i has to
return false;

but its returns the query
any help !!


According to the documentation of Session Documentation

CodeIgniter supports “flashdata”, or session data that will only be available for the next request, and is then automatically cleared. This can be very useful, especially for one-time informational, error or status messages

See also this link