This topic is locked

Help with update of date field

9/22/2007 10:02:13 AM
PHPRunner General questions
B
Blooper author

Good day to all who read this. I've posted my question via replies on other poses (thanks to those who answerd), but I feel I should post it correctly to finaly get an answer.
I've reg though all the posts I can find to do this, but none of them work. I've tried to add the code in the after,before,on load, after sucses, but nothing works.

I've tried all the code I could find and differant ways aswell.
I'm trying to update the date_join field when a new person joins. This is for a modeling agency. When person register on the registration page the date must show the date they signed up. After that I would like to rerirect them to the edit their own data page, but that is another story.
I could post all the varioations and code I've tried, but I would like to start from "scratch". Thanks again for a awsome forum and program!
Below is all the info U might need.
Using PHPRunner 4.0 Build 265

Type using in phprunner's Visual editor : Short date
View page.

http://www.nvg.co.za/php/Models_view.php?editid1=22

Or register.

www.nvg.co.za/php
Database name: nvscouts
Table : Models
Fieldname : date_join

Field type : date

Field Null : no
Deafult : 0000-00-00

Sergey Kornilov admin 9/22/2007

Set default value of this field to now(). This is it.

B
Blooper author 9/23/2007

Set default value of this field to now(). This is it.


Hello
Thanks for the advice. I've tried folowing your advice. I've tried to change the deafult in myphpadmin, but it does not want to take the now() or 'now()' or "now()" or NOW() etc. It still keeps the 0000-00-00. I then tried to put the now() in the deafult in the visual editor. I can not add it in the view section. I tried to add it in the edit section with the now() default section, then delete it (probibly not work). The user are not suppose to edit the jion date. It is only suppose to show when someone displays the information. I thought I could put it in the edit section, then hide is somehow so that the deafult now() still is active, but the now() does not work. I've also tried it on the birthday selection that can be edited, but that one also only shows the 0000-00-00 before they edit it. I see U can also choose the simpe edit box, simple edit box with date picker, drop down boxes etc. Will the now() only work when choosing one of them or will it work with all of them.
Thanks again for the help.

B
Blooper author 9/23/2007

Hello again. I "solved" it.
I changes the table's type to TIMESTAMP instead of DATE. It then updated the date automaticaly. It then display's the correct date. I just hope that is will not update everytime the user logs in, but it will be perfect for the last logged in section. I will have to wait till the date on the server changes and then see.

B
Blooper author 9/23/2007

Never mind. Scratch that.
Seem like the U can only create one of those tables. And it updates every time U acsess it. Not sure it I would like to use it, so I'm back to stage 1.