Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 !!

like image 725
Muhammed A. Rdwan Avatar asked Apr 09 '26 09:04

Muhammed A. Rdwan


1 Answers

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

like image 91
Oli Soproni B. Avatar answered Apr 11 '26 22:04

Oli Soproni B.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!