Welcome Guest, Not a member yet? Register   Sign In
Best Practices for No Results from Database Query?
#1

[eluser]kirkaracha[/eluser]
What's the best way to report that a database query doesn't return any results? I've been checking $query->num_rows() in my controllers, setting a message if there aren't any results, and loading a view to display the message. That makes for a lot of redundant code in my controllers. Is there a better/more efficient way of handling this, maybe in MY_Controller or MY_Model?


Messages In This Thread
Best Practices for No Results from Database Query? - by El Forum - 02-08-2010, 04:02 PM
Best Practices for No Results from Database Query? - by El Forum - 02-08-2010, 05:32 PM
Best Practices for No Results from Database Query? - by El Forum - 02-08-2010, 05:52 PM
Best Practices for No Results from Database Query? - by El Forum - 02-08-2010, 06:08 PM
Best Practices for No Results from Database Query? - by El Forum - 02-08-2010, 06:16 PM
Best Practices for No Results from Database Query? - by El Forum - 02-08-2010, 06:29 PM



Theme © iAndrew 2016 - Forum software by © MyBB