Why are we saying SLUG = FALSE? |
1. So when retrieving data from db they are saying $slug=FALSE - Why and what does it mean?
Also why are we checking if $slug is false? public function get_news($slug = FALSE) { if ($slug === FALSE) { $query = $this->db->get('news'); return $query->result_array(); } $query = $this->db->get_where('news', array('slug' => $slug)); return $query->row_array(); } 2. So if $slug ==== FALSE then it will execute whatever is inside IF curly brackets and then will also execute the $query = $this->db->get_where('news', array('slug' => $slug)) ?? 3. Do I need to use if slug===false? |
Messages In This Thread |
Why are we saying SLUG = FALSE? - by lexxtoronto - 03-18-2015, 01:12 PM
RE: Why are we saying SLUG = FALSE? - by mwhitney - 03-18-2015, 01:25 PM
RE: Why are we saying SLUG = FALSE? - by lexxtoronto - 03-18-2015, 01:55 PM
RE: Why are we saying SLUG = FALSE? - by CroNiX - 03-18-2015, 02:27 PM
RE: Why are we saying SLUG = FALSE? - by lexxtoronto - 03-18-2015, 06:17 PM
RE: Why are we saying SLUG = FALSE? - by mwhitney - 03-19-2015, 08:01 AM
RE: Why are we saying SLUG = FALSE? - by lexxtoronto - 04-08-2015, 06:07 PM
|