34k+
News
Guide
API
Wiki
Forum
Community
Places
Members
Hall of Fame
Badges
More
Learn
Books
Resources
Develop
Download Yii
Extensions
Report an Issue
Report a Security Issue
Contribute to Yii
Donate
About
Release Cycle
License
Team
Official Logos and Design
Login
Getting nulls from database instead of empty strings
Comparing
#1
with
#2
Revision #2 was created by
samdark
on May 29, 2011, 6:31:29 PM.
Corrected that actual values written aren't nulls
« Previous (#1)
Title
Sav
Gett
ing nulls
to
from
database instead of empty strings
Content
To
write
get
`null`
from database
instead of empty strings
to database when saving empty values
you need to set up your DB connection as follows:
```php
'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=test',
[...]