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

 Adding dates to a MySQL field

Print topic Send  topic

Author Message
Jer

Posts: 25
Posted: 03/10/2008, 3:19 PM

On my tables I've added 3 fields:

datecreated, dateupdated - both are datetime fields.

and updatedby which is an integer field.

I want to add the date and time to the first two fields. For the last, I want to insert the UserID of the current user.

I'm not sure how to go about this without modifying the source code directly.

I've looked at the Events, and I see a "Before Build Insert." The problem is, I'm not sure how to add the code that would insert the values for the 3 fields above.

Any help greatly appreciated.

Thanks,

Jer
View profile  Send private message
nhbw19t


Posts: 29
Posted: 03/28/2008, 8:50 PM

Insert mode

the easist way is to make the date fields text instead of a date format.

insert mode

set the db format to yyyy-mm-dd HH:nn:ss or whatever you have set in the db
default value = date("Y-m-d H:i:s")

userid = integer field
default value = CCGetUserID()

update section

add a before update event

retrieve value for control

select your date field
expression
source type - date("Y-m-d H:i:s")

repeat for other date

source type CCGetUserID()

Hope this helps;

----------------------------


On my tables I've added 3 fields:

datecreated, dateupdated - both are datetime fields.

and updatedby which is an integer field.

I want to add the date and time to the first two fields. For the last, I want to insert the UserID of the current user.

I'm not sure how to go about this without modifying the source code directly.

I've looked at the Events, and I see a "Before Build Insert." The problem is, I'm not sure how to add the code that would insert the values for the 3 fields above.

Any help greatly appreciated.
_________________
J.D. Archer
GE Transportation
View profile  Send private message

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.

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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