Phil
|
| Posted: 07/16/2005, 12:25 AM |
|
Being fairly new to all this php and codecharge, I am wondering if it's possible to dyamically alter a database entry based purely on the date?
i.e. I have an expiry date for an item, which needs to when it reaches that date, not show up in the publicly displayed pages anymore and, also needs to move to an expired offers section within the admin section of the web site
Sorry if that's not very clear, but any questions or suggestions which might help me figure some of it out would be most appreciated.
Cheers.
Phil.
|
|
|
 |
Walter Kempees
|
| Posted: 07/16/2005, 6:24 AM |
|
Phil,
Easy solution would be to have a field "expired" in your table, either a
date or a boolean value.
On your normal grid (publicly published page) select all rows where not
expired and display them.
In before show row you could then easily test the expiry date against todays
date (or todays date +1 being tommorow) and subsequently update the row
setting the value for expired.
The administrator version would off course do same select but "where
expired" .
Harder but feasible, run a separate sql statement updateing rows setting
expired where select * from same table where expiry date is today.
Or in stead of updating rows copying them to another table, deleting them
after copying.
GoodLuck
Walter
"Phil" <Phil@forum.codecharge> schreef in bericht
news:542d8b65c7dfd0@news.codecharge.com...
> Being fairly new to all this php and codecharge, I am wondering if it's
> possible
> to dyamically alter a database entry based purely on the date?
>
> i.e. I have an expiry date for an item, which needs to when it reaches
> that
> date, not show up in the publicly displayed pages anymore and, also needs
> to
> move to an expired offers section within the admin section of the web site
>
> Sorry if that's not very clear, but any questions or suggestions which
> might
> help me figure some of it out would be most appreciated.
>
> Cheers.
> Phil.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
|