Codeigniter flashdata works inside false if statement
i am not new to codeigniter 2 but i haven't used flashdata before and i started using it today i have weird problems i create 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 request perfect and also triggers flashdata I'm sure num_row is <1, and if I shouldn't return false;
but return the request any help!
+3
source to share
1 answer
As per the documentation Session documentation
CodeIgniter maintains "flashdata" or session data that will only be available for the next request and then automatically flushed. This can be very useful, especially for one-time informational messages, error messages or status messages.
See also this link
+3
source to share