Jump to content

getting White Screen of Death when I have mysql error.. I need to see error??


Recommended Posts

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?

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 (;)

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!

 

 

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.