CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Dynamically altering a database

Print topic Send  topic

Author Message
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/
>


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.