Welcome Guest, Not a member yet? Register   Sign In
How to hide database error?
#1

[eluser]murtuza54[/eluser]
Hi

I want to hide any database error like 1064 or 1054

exa :
Code:
A Database Error Occurred
Error Number: 1054

Unknown column ‘abc’ in ‘field list’

INSERT INTO `table1` (`ID`, `ss`, `jj`, `abc`)


as we know it shows defected query with table name and fields.
Is there any way to redirect that page to some other decorative error page?
I dont want to show any kind of database table name or error on site?
#2

[eluser]janogarcia[/eluser]
Hi,

Set db_debug to FALSE in application/config/database.php

Code:
$db['default']['db_debug'] = FALSE;

More info in the Database configuration documentation.
#3

[eluser]murtuza54[/eluser]
Thank you very much.
Its stops displaying database errors.

but can we redirect this to some other page?
#4

[eluser]murtuza54[/eluser]
I got answer for that.
In application/errors, there are all error files. i have put redirection code in each file to my custom error page. this way it works. other way is we can modify existing error pages also the way we like.

Thank you.




Theme © iAndrew 2016 - Forum software by © MyBB