Determine MySql mode from PHP

3k views Asked by At

Is there any way to find if mysql server is in strict mode or not from PHP? I need to find out this at runtime(in installation script), so I can inform user if his system satisfy script requirements.

2

There are 2 answers

0
xdazz On BEST ANSWER

SELECT @@sql_mode; will give what you want.

0
aayush  sharma On

I think you can run a simple query like

SELECT @@sql_mode;

This should be able to get you your SQL mode. There is more information at http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html about how you can manage the mode if need be.