How to test PHP in MySQL Strict

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Mr Tech
Forum Contributor
Posts: 424
Joined: Tue Aug 10, 2004 3:08 am

How to test PHP in MySQL Strict

Post by Mr Tech »

I had a client who had MySQL Strict which brought up a few errors in my MySQL code... I didn't even know there was a MySQL Strict. I've fixed up a lot of the issues but I want to run some further tests on my local server.

How do I enable MySQL Strict for testing purposes and then disable it when I no longer want it?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: How to test PHP in MySQL Strict

Post by requinix »

Uh... maybe you mean PHP's Strict warnings?

Everywhere: Find the error_reporting in your php.ini and set it to

Code: Select all

error_reporting = E_ALL | E_STRICT
Don't forget to restart the web server.

Per-script: Use error_reporting:

Code: Select all

error_reporting(E_ALL | E_STRICT);
User avatar
Mr Tech
Forum Contributor
Posts: 424
Joined: Tue Aug 10, 2004 3:08 am

Re: How to test PHP in MySQL Strict

Post by Mr Tech »

Thanks tasairis but I mean MySQL Strict mode. I only just found out about this recently :)
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: How to test PHP in MySQL Strict

Post by requinix »

I take it you couldn't find anything searching?
User avatar
Mr Tech
Forum Contributor
Posts: 424
Joined: Tue Aug 10, 2004 3:08 am

Re: How to test PHP in MySQL Strict

Post by Mr Tech »

All I could find is how to turn off strict mode... But i'll have another look and see what I can find.
Post Reply