Skip to main content

should i disable strict mode?

Comments

3 comments

  • User Avatar
    ffeingol
    You are correct that it can only be done via my.cnf (as it's a MySQL setting not a PHP setting). It won't cause corruption, but turning it off is more of a band-aid than anything else. As an example: Let's say you have a table that has a char(10) column (that is a column that holds up to 10 characters). With strict mode off if they try to put 11 characters in the column MySQL will simply truncate the 11th character and move on. With strict mode on they will get a SQL error, since it can't store the data. There are other scenarios, but it all basically boils down to poor/sloppy coding. All modern open source software has no issues with strict. What we've come across is one-off / hand coded sites. Hopefully that helps a bit.
    0
  • User Avatar
    uk01
    Thank you that helps alot and I appreciate your reply. We will refuse the request on the cpanel platform. They also have a vps so I will advise them to install mysql there and connect remotely to that database.
    0
  • User Avatar
    cPRex Jurassic Moderator
    Thanks @ffeingol !!! Great explanation!
    0

Please sign in to leave a comment.