This topic is locked

Insert a CURDATE()

6/4/2007 8:41:43 AM
PHPRunner General questions
M
Momo99 author

Hey,
I'm using phprunner 4.0.
I want to add a CURDATE() mysql insert statement that will be hidden from the user when using the ADD form of the database.

so basically the user will fill in all the variables press "save" and in the same sql statement that will save the variables into the database.table i will also include a CURDATE() insert that will fill in a field in the same raw in the table regarding at what date that line was submitted.
I looked into the php pages on the website, but i can't find the mysql insert statement.

Any help will be very appreciated.

J
Jane 6/4/2007

Hi,
to add timestamp to the record use now() function as default value on the "Edit as" settings dialog on the Visual Editor tab.

M
Momo99 author 6/7/2007

Hi,

to add timestamp to the record use now() function as default value on the "Edit as" settings dialog on the Visual Editor tab.


Tnx, for your reply.

I would like that field to be a hidden field. Hence I don't want the user to be able to see this as an option in the "add" and "edit" tabs. Is it possible?
Tnx

Sergey Kornilov admin 6/7/2007

You can use BeforeAdd/BeforeEdit events for this purpose:

$values["FieldName"] = now();
D
dcrera 6/11/2007

Hi,
$values["FieldName"] = now();
The above is reporting a time 1 hour ahead of the current time.
I checked the time on my oracle database and it is correct.
Where is Phprunner getting the time from ?
Thanks