Below is my code
$state = $data['state'];
$this->db->select("state")->from('table')
->where('en_movingfrom_state', $state)
->where('status', 3);
I want to execute this query, if $state is set then where condition will execute.
So please help me how can i do this?