Consider the following two database servers:
Database server 1:
•Server: Localhost via UNIX socket
•Tipo di server: MySQL
•Versione del server: 5.5.48-cll - MySQL Community Server (GPL)
•Versione protocollo: 10
Web server
•cpsrvd 11.54.0.15
•Versione del client del database: libmysql - 5.1.73
phpMyAdmin
•Informazioni sulla versione: 4.0.10.7, versione stabile piú recente: 4.5.4.1
============
Database server 2:
•Server: Localhost via UNIX socket
•Tipo di server: Percona Server
•Versione del server: 5.6.27-75.0 - Percona Server (GPL), Release 75.0, Revision 8bb53b6
•Versione protocollo: 10
Web server
•cpsrvd 11.52.3.1
•Versione del client del database: libmysql - 5.1.73
phpMyAdmin
•Informazioni sulla versione: 4.3.8, versione stabile piú recente: 4.5.4.1
I use doctrine. In a table I have two nullable fields. These are set nullable in both doctrine entities and in database. In script I have two form fields for those two db fields but if form field1 is filled in, filled2 must be null, not both of them should be saved in db. So in script I have a IF condition to check if field1 is not empty then $field2 = “”
field2 type may be set int(11) or decimal(3,10), just not string. but as I said this is nullable.
It works fine in server 1 above but in server2 I get integrity invalid integer for field2 error, because I have $field2 = “” but if I change it to $field2 = null instead of “” it works fine in server2 too.
Is it a normal behavior and the only way to fix the issue is changing “” to null or is there any better way to solve it? What are the difference of these two servers? this error is just because server2 is Percona? or what? why $field2 = “” is incompatible with server2 and how to solve it?