Welcome Guest, Not a member yet? Register   Sign In
How to avoid ugly 'Error Number: 1146' (database) errors
#1

[eluser]Zeff[/eluser]
Dear all,

Everyone has ever seen an 'Error Number: 1146' error (e.g. a call to a non existing table or an existing table in the wrong database...) while coding in models. Is there anyone who knows how to avoid this ugly error and show a nice error message to the user without breaking the rest of the code?

I tried it by using a try-catch exception block, but it doesn't help...
<code>
try {
$this->load->model('some_model', 'mymodel'); // During this load, error is thrown
$temp['results'] = $this->mymodel->get_all_results();
} catch (Exception $e) {
echo '<p>Some gentle message...</p>';
}
</code>

Thanks in advance for suggestions and help!

Zeff


Messages In This Thread
How to avoid ugly 'Error Number: 1146' (database) errors - by El Forum - 08-02-2013, 12:48 AM



Theme © iAndrew 2016 - Forum software by © MyBB