I am using Zend Framework with MySQL,Apache and Ubuntu 9.04.
I am trying to insert NULL values into database like this:
$personObj->setPersonId( '1' );
$personObj->setPersonEmail('NULL');
$personObj->save();
But 'NULL' is stored in database as string and not NULL.
When I use this:
$personObj->setPersonId( '1' );
$personObj->setPersonEmail(NULL);
$personObj->save();
But nothing happens and previous entry is unchanged.
What should I do to insert NULL values into MySQL?
$personObj
? As others already said, without knowing the implementation ofsetPersonEmail()
you cannot determine what has to be passed in. – PhonemicsetPersonEmail()
andsave()
; especially important is how the data is written to the database. A lot of things can happen in between callingsave()
and the time when the data is written to the database. – Phonemic