![]() |
Alexey admin 10/30/2006 |
Stephan, |
M
|
mmponline author 10/31/2006 |
Alexey
|
![]() |
Alexey admin 10/31/2006 |
Stephan, "`ClosingDate` >now()"
|
M
|
mmponline author 10/31/2006 |
Thanks. This works exactly as I want it. |
J
|
Jane 10/31/2006 |
Try to use DATE_ADD MySQL function. "`ClosingDate` >date_add(now(),INTERVAL 1 DAY)" |
M
|
mmponline author 10/31/2006 |
This works fine on the add page, thanks Jane! |
T
|
thesofa 10/31/2006 |
This works fine on the add page, thanks Jane! Now, on the list (view) page I currently use the following code: if ($value<now()) { $value = "<font color=red>".$value."</font>"; } It obviously displays today as expired. Is there a way to edit this: now(),INTERVAL 1 DAY) code to display today as active as well?
|
M
|
mmponline author 11/1/2006 |
Nope Could you use If (!$value>=now())
or should it be If($value!>=NOW())
|
T
|
thesofa 11/1/2006 |
I had similar problems, remember NOW() includes the time as well, if it is saved to a date field, the time part of the value is set to 00.00.00, hence any expression with now() in it will be bigger than a field with today's date in it. |
M
|
mmponline author 11/1/2006 |
Let's see if anyone has a good suggestion. |
![]() |
Alexey admin 11/1/2006 |
Stephan, // split $value to array $arr = db2time($value); // construct time $t = mktime($arr[3],$arr[4],$arr[5],$arr[1],$arr[2],$arr[0]); // compare time with current time subtracted by 2 days if($t > time()) $value = "<font color=red>".$value."</font>";
|
M
|
mmponline author 11/1/2006 |
Nope, this code gives the following PHP Error |
![]() |
Alexey admin 11/1/2006 |
Stephan, if($value) { // split $value to array $arr = db2time($value); // construct time $t = mktime($arr[3],$arr[4],$arr[5],$arr[1],$arr[2],$arr[0]); // compare time with current time subtracted by 2 days if($t < time()-26060*24) $value = "<font color=red>".$value."</font>"; } |
M
|
mmponline author 11/1/2006 |
Empty field was one of the problems. |