Welcome Guest, Not a member yet? Register   Sign In
I do not want to HIDE notices. I want to make them not a "notice"
#1

[eluser]internut[/eluser]
So if i get this in the error log:

ERROR - 2011-06-30 22:35:01 --> Severity: Notice --> Undefined variable: fieldNames

its a function within a model returning values from a DB Query.

End of function / method:


return $fieldNames;

do i just do a

$fieldNames = '';

at the top. Which will give me no error... I do not like the @ Suppress method.

What is the best practice?

CI logs all of this undefined errors.

I'd like a clean log file Smile

Any quick insight I'm very grateful for! I'm pretty savvy with CI, but now I'm on to making it error free in logs Smile

No errors go to screen. Just in the log file as I have error logging set to:

error_reporting(E_ALL ^ E_NOTICE);

Thanks much!
#2

[eluser]InsiteFX[/eluser]
error_reporting

InsiteFX
#3

[eluser]internut[/eluser]
I can turn off notices... they still fill the logs up. trying to have error notices on. let CI log them . and fix them.
#4

[eluser]InsiteFX[/eluser]
Try turning off:
application/config/database.php
Code:
$db['default']['db_debug'] = FALSE;

CI will not fix your errors, that is up to you to fix them.

InsiteFX
#5

[eluser]internut[/eluser]
Thanks Inside. Not looking for CI to fix them. I've fixed a bunch. Some are quite odd. I'll keep plugging away.
#6

[eluser]misplacedme[/eluser]
The best practice is to never use or return a value that has not been initialized. This dates all the way back to C. If you don't use unititilized values, it is easier to track down problems.
#7

[eluser]internut[/eluser]
[quote author="misplacedme" date="1309563222"]The best practice is to never use or return a value that has not been initialized. This dates all the way back to C. If you don't use unititilized values, it is easier to track down problems.[/quote]

Appreciate the feedback. I got all the PHP notice errors corrected. Going to dig into caching now.

Jason




Theme © iAndrew 2016 - Forum software by © MyBB