I'm more worried about the interaction of the php code with the database:
mysql> create table test (id int not null, name varchar(255));
Query OK, 0 rows affected (0.27 sec)
mysql> insert into test values (1,"");
Query OK, 1 row affected (0.00 sec)
mysql> insert into test values (1,NULL);
Query
Try this:
Echo "" == NULL;
-Alex
-Original Message-
From: Dennis Jacobfeuerborn
Sender: symfony-users@googlegroups.com
Date: Sun, 27 Mar 2011 15:34:06
To:
Reply-To: symfony-users@googlegroups.com
Cc: Bernhard Schussek
Subject: Re: [symfony-users] [Symfony2] Forms/Doctrine em
As long as the framework guarantees that this normalization always takes
place I guess I can rely on that and make the field null-able.
I just wasn't sure and feared running into problems later on because the
database sees null and an empty column as two different values.
Regards,
Dennis
--
Hi Dennis,
The form framework normalizes empty values to null by default. Why
would you allow empty strings but not null?
Bernhard
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed
: symfony-users@googlegroups.com
Subject: [symfony-users] [Symfony2] Forms/Doctrine empty string vs. NULL
Hi,
I'm trying to create a form for an entity with a field that is defined as
"NOT NULL" in the schema but with the field allowing to contain an empty
string.
The problem
Hi,
I'm trying to create a form for an entity with a field that is defined as
"NOT NULL" in the schema but with the field allowing to contain an empty
string.
The problem is that when I set required to false on the field and submit the
form with not putting anything in it I get an exception that