Preventing errors on site

4 posts by 2 authors in: Forums > CMS Builder
Last Post: February 15, 2016   (RSS)

By pault - February 10, 2016

I'm trying to prevent MySQL errors from being displayed on a production site when using list viewers.

If I have an incorrectly formed SELECT statement for example then the site displays a blank page with an error message along the lines of the following:

MySQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '") ORDER BY dragSortOrder' at line 3

I've tried turning on the setting 'Hide all PHP errors and warnings' but this doesn't prevent the error from displaying.

If I try and edit cmsb/lib/init.php to change error_reporting(-1) to be error_reporting(0) then i get another error about the error log.

Essentially, I never want a website visitor to see one of these errors, can you suggest anything?

Thanks!

By gregThomas - February 11, 2016

Hi Pault,

What functions / code are you using to make the MySQL call?

Cheers,

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By pault - February 12, 2016

Hi Greg,

I think I may have found the cause of the problem.  The PHP variable display_errors was set to 1 on the server and this couldn't be overridden locally so no matter what I tried, the errors displayed.

Regards, Paul.