gabucknall Posted June 3, 2014 Share Posted June 3, 2014 I am writing a database using php mysql. I have a page which works fine but if I add one extra query it just produces a blank page. I remember once that someone said I could put in some code at the start of the page and it would display any errors but can't remember the code! Could someone let me have the code and does anyone have any suggestions as to why this blanking is happening? Many thanks Quote Link to comment https://forums.phpfreaks.com/topic/288970-blank-pages-and-error-display/ Share on other sites More sharing options...
trq Posted June 4, 2014 Share Posted June 4, 2014 Could someone let me have the code <?php error_reporting(E_ALL); init_set('display_errors', 1); does anyone have any suggestions as to why this blanking is happening? Sorry, Ive lost my crystal ball. Quote Link to comment https://forums.phpfreaks.com/topic/288970-blank-pages-and-error-display/#findComment-1481812 Share on other sites More sharing options...
Jacques1 Posted June 4, 2014 Share Posted June 4, 2014 Doing the error configuration at runtime doesn't help if the error happens before the script runs. This is not the case here, but you're likely to run into more errors in the future. So the proper solution is to open your php.ini and fix your global configuration: display_errors must be On, error_reporting should be -1. Of course you only do this in your local test environment. On a live server, you log the errors, not display them. Note, however, that PHP does not automatically display MySQL errors. If the query itself fails, then you will not see that by default. How to get the error message depends on the database extension you're using. As trq already said, your question is very vague. Quote Link to comment https://forums.phpfreaks.com/topic/288970-blank-pages-and-error-display/#findComment-1481831 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.