flashmac Posted August 2, 2009 Share Posted August 2, 2009 Hi, When I make a mistake in an sql query, I get the WSOD, but what I really need is to see the error (as im working on localhost). Ive tried all the usual suspects, eg. error_reporting(E_ALL) ini_set('display_errors', '1'); removing the '@' symbol My php.ini looks fine and ive restarted my apache, but the above dont have any effect. Anyone out there have an idea how i can get the errors to display? Quote Link to comment https://forums.phpfreaks.com/topic/168520-getting-white-screen-of-death-when-i-have-mysql-error-i-need-to-see-error/ Share on other sites More sharing options...
wildteen88 Posted August 2, 2009 Share Posted August 2, 2009 In your php.ini you need to make sure display_errors is set to On and that error_reporting is set to E_ALL. Save the php.ini and restart Apache. NOTE Make sure you're editing the correct php.ini. To confirm, run phpinfo and look at the Loaded Configuration File. This will tell you the full path to the php.ini PHP is reading. Make sure you're not editing lines that start with a semi-colon ( Quote Link to comment https://forums.phpfreaks.com/topic/168520-getting-white-screen-of-death-when-i-have-mysql-error-i-need-to-see-error/#findComment-888965 Share on other sites More sharing options...
flashmac Posted August 2, 2009 Author Share Posted August 2, 2009 Thanks for reply.. but already thought of all those things. Definitely editing the right php.ini file (tripled checked this by changing other settings which took effect) error reporting is on and .ini file is also set to E_ALL. im not editing lines with a semi-colon either.. this has got me completely stumped! Quote Link to comment https://forums.phpfreaks.com/topic/168520-getting-white-screen-of-death-when-i-have-mysql-error-i-need-to-see-error/#findComment-888975 Share on other sites More sharing options...
wildteen88 Posted August 2, 2009 Share Posted August 2, 2009 Post your code here that you're having problems with. Quote Link to comment https://forums.phpfreaks.com/topic/168520-getting-white-screen-of-death-when-i-have-mysql-error-i-need-to-see-error/#findComment-888984 Share on other sites More sharing options...
flashmac Posted August 2, 2009 Author Share Posted August 2, 2009 OK I was only partionally right.. if I create a simple mysql error ie SELECT * FR!OM table then it does spit out the error on screen, but my queries are inside a class and call a function inside the DB class using the SQL as a parameter. If I create a mysql error then I get the WSOD. Here is a snippet example from my code. class database { public function query($sql) // at this point I cant even echo the $sql, its just WSOD } class user { $sql = "SELECT * FROM user"; // this works fine $sql = "SELECT * FROOM user"; // this throws WSOD instead of onscreen error $res = $xxx->query($sql); //$xxx is an instance of the database class } Appreciate any clarity wildteen88. Quote Link to comment https://forums.phpfreaks.com/topic/168520-getting-white-screen-of-death-when-i-have-mysql-error-i-need-to-see-error/#findComment-889003 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.