Jump to content

Disable error reporting ?


Rommeo

Recommended Posts

For example when I enter wrong data for one textbox, lets say I typed digits instead of chars. mysql gives me an error like "wrong entry... WHERE workername=125 and male=yes on line 25".. etc as I read this may cause security problems. I dont have this much simple mysql warnings but I want to disable to print mysql error warnings.

 

Is there anyway to do it ?

Link to comment
Share on other sites

It will cause more security problems if you don't fix these errors.  You should handle them appropriately.  To answer your question, there is a way to turn them off, one is through php.ini and the other is in lined in the script.

Link to comment
Share on other sites

I agree with jesirose's basic advice.  For a production server, you should turn this off http://www.php.net/manual/en/errorfunc.configuration.php#ini.display-errors.  You should however log errors to a log file.

 

With that said, if you are using mysql error handling those are not php errors.  So if you're doing this or something similar:

 

if (!$result)  {
  echo mysql_error();
} else {

 

then you need to instead, write that to an error log of your own making. 

Link to comment
Share on other sites

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.