Welcome Guest, Not a member yet? Register   Sign In
Why are we saying SLUG = FALSE?
#1

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?
Reply


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 CroNiX - 03-18-2015, 02:27 PM
RE: Why are we saying SLUG = FALSE? - by mwhitney - 03-19-2015, 08:01 AM



Theme © iAndrew 2016 - Forum software by © MyBB