Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine MySql mode from PHP

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.

like image 839
Ivica Avatar asked Jul 06 '26 04:07

Ivica


2 Answers

SELECT @@sql_mode; will give what you want.

like image 195
xdazz Avatar answered Jul 08 '26 20:07

xdazz


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.

like image 36
aayush sharma Avatar answered Jul 08 '26 19:07

aayush sharma



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!