[eluser]v33s[/eluser]
Hello all! I have a problem. Could someone help me?
Actually I am making articles script, method from controller:
Code:
function _viewArticle($id)
{
if(is_null($id))
{
redirect('');
}
else
{
$query = $this->show_arts->getPage($id);
if($query->result() < 0)
{
show_error('There arent any articles.');
}
elseif($this->uri->segment(3) != $query->count_all())
{
show_error('That article doesnt exist.');
}
else
{
foreach ($query->result() as $row)
{
$this->load->view('show', $row);
}
}
}
And I have problem with This:
Code:
elseif($this->uri->segment(3) != $query->count_all())
{
show_error('That article doesnt exist.');
}
How to replace the code below when I get url: /index.php/show/article/id
And article with uri segment 3 does not exist in database?
Regards.