문제

Codeigniter 2.0 gives internal server error if there is a database error.

and this is how i have coded...

if($this->db->query($query))showerror();

but the the query method is throwing an error before the if condition gets executed.

i wanted to do condition check whether there is an error in the query or what ever the database error is and i dont want codeigniter to throw an error.

How do i do like what i think? this is how previous versions of CI worked.

Is there a specific reason to thrown an error with the HTTP status code of 500.

why it has been changed like this?

도움이 되었습니까?

해결책

Which v2.0.x?

Internal 500 will happen if there is an error and no output. This will happen if its disabled (you've set the ENVIRONMENT to "production", and so will be hidden) or if your server will not display errors.

Make sure error_reporting(E_ALL) is happening, and ini option display_errors = 1.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top