[eluser]coding[/eluser]
i want to redirect people to home page whenever they try to access undefined page.i've written an easy code but it isn't working.
first of all code......
Note:- I'm a newbie web developer and this is my first project I'm developing.( fun project)
This is the controller
-------------------------------------------------------------------------
function celebs()
{
$currenturl = current_url();
$compare = 'http://localhost/ci/index.php/home/celebs/';
if( $compare == $currenturl )
{
redirect('/home', 'refresh');
}
else
{
$data['query'] = $this->db->query('select * from celebs where cat_id = '.$this->uri->segment(3).' order by f_name');
$data['count'] = $this->db->query('select * from clips where celeb_id = '.$this->uri->segment(3).'');
$this->load->view('celebs',$data);
}
}
---------------------------------------------------------------------------------
now error
---------------------------------------------------------------------------------
A Database Error Occurred
Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by f_name' at line 1
select * from celebs where cat_id = order by f_name
------------------------------------------------------------------------------------