Difference between #1 and #3 of
Search method of a model for filters when using dates - unixtimestamp in database

Changes

Title unchanged

Search method of a model for filters when using dates - unixtimestamp in database

Category unchanged

Tips

Yii version unchanged

Tags changed

cdbcriteria, model, search, filter, cgridview

Content changed

[...]
```php
$criteria->condition = ':s<=start AND start<=:e';
$criteria->params=array(':s'=>$daystart,':e'=>$dayend);
```
now because if you put nothing in the date search field of the filter it would result in no records found. This is because an
d empty date would try to find on a mktime(0,0,0,0,0,0) which results in januariey 1st 1970 or something, so unless you have an event that exact date (would seem most unlikely), you will have no results. tTherefor we would just check if empty before doing the condition, my complete search methond would be something like this( bar the other attributes that can be searched)

```php
public function search()
{
[...]
10 0
11 followers
Viewed: 37 265 times
Version: 1.1
Category: Tips
Written by: Mukke
Last updated by: jwerner
Created on: Feb 10, 2011
Last updated: 12 years ago
Update Article

Revisions

View all history