Closed GoogleCodeExporter closed 8 years ago
I've been away from PHP programming for a while. In your opinion should I
remove the
@ from the front of the following lines too?
1048 function run_query($sql, $conn) {
1049 global $debug;
1050 debug($sql);
1051 $result = @mysql_query($sql, $conn);
1052 if ( $debug ) {
1053 $error = @mysql_error($conn);
1054 if ( $error ) {
1055 debug(array($sql, $error));
1056 die("SQLERR $error in $sql");
1057 }
1058 }
1059 $array = array();
1060 while ( $row = @mysql_fetch_array($result) ) {
1061 $array[] = $row;
1062 }
1063 debug(array($sql, $array));
1064 return $array;
1065 }
I think I should not -- if those lines cause errors it'll be well handled and
reported, I think. But I just thought I'd ask your opinion.
Original comment by baron.schwartz
on 25 Dec 2009 at 6:50
This issue was closed by revision r366.
Original comment by baron.schwartz
on 25 Dec 2009 at 6:51
In general: I would suggest du use the ini setting "display_errors" in
condition with the
debugging flag. Means: if the debugging option is giving, display errors, if
not, don't.
That way, error suppression is not needed, the script will fail gracefully if
debugging is
enabled and yield human readable error messages.
Thanks for the fix!
Original comment by lars.str...@gmail.com
on 27 Dec 2009 at 12:42
Original issue reported on code.google.com by
lars.str...@gmail.com
on 16 Dec 2009 at 11:44