Redirect |
[eluser]georgerobbo[/eluser]
Hello, I have a controller which intercepts the second url segment, passes it along the model which queries the database for the ID present in the url. Everything is then passed to the view. Works a treat, except for when you type an ID in the url which isn't in the database. For example, http://georgerobbo.dyndns.org/yellowdogy...x.php/id/1 and http://georgerobbo.dyndns.org/yellowdogy...x.php/id/2, however http://georgerobbo.dyndns.org/yellowdogy...x.php/id/3 returns a CodeIgniter error. How can I replace that error with a redirect? My controller is as follows, where function single() is the controller for each individual post. Code: <?php
[eluser]rogierb[/eluser]
Check if you have any result from the database: Code: if($data['current']->num_rows()>0) |
Welcome Guest, Not a member yet? Register Sign In |