Rommeo Posted February 11, 2011 Share Posted February 11, 2011 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 ? Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 11, 2011 Share Posted February 11, 2011 Fix your code so it doesn't generate errors. When it's all fixed, you can move to production, and turn off error reporting. Quote Link to comment Share on other sites More sharing options...
Maq Posted February 11, 2011 Share Posted February 11, 2011 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. Quote Link to comment Share on other sites More sharing options...
gizmola Posted February 11, 2011 Share Posted February 11, 2011 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. Quote Link to comment 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.