Getting nulls from database instead of empty strings

You are viewing revision #2 of this wiki article.
This is the latest version of this article.
You may want to see the changes made in this revision.

« previous (#1)

To get null from database instead of empty strings you need to set up your DB connection as follows:

'db'=>array(
  'connectionString' => 'mysql:host=localhost;dbname=test',
  'username' => 'root',
  'password' => '',
  'charset' => 'utf8',
   
  // here it is:
  'nullConversion' => PDO::NULL_EMPTY_STRING,
),