This topic is locked

Problems Updating Date field

2/27/2007 7:28:24 AM
PHPRunner General questions
J
Janeward author

Please help!!! Cannot populate Date field
Created the following:
Table Name: _sampletable
Field: username VARCHAR 50

Field: firstname VARCHAR 50

Field: lastname VARCHAR 50

Field: register_date DATE

Field: modified_date DATE

Field: ID INT (Primary Key)
Table Name: _Adminperson
Field: username VARCHAR 50

Field: ID INT (Primary Key)
Set up PHPrunner to allow the user to intially Register.

When user registers, they are directed to the List Page and shown there 'username' & 'ID' - all other fields are blank.

I want the user to see the current date in the register_date field.
Additionally,
For the sake of arguement the user enters there 'firstname' & 'lastname' in the Edit Page a week later

I want the user to see the date in the modified_date field on the List Page
Please HELP
Thanks in advance

Jane <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=4712&image=1&table=forumtopics' class='bbc_emoticon' alt=':(' />

J
Jane 2/27/2007

Jane,
you can set up default value of register_date field as now() on the "Edit as" settings dialog on the Visual Editor tab.
To change modified_date field on the Edit page use Before record updated event on the Events tab. Here is a sample:

$values["modified_date"]=now();

J
Janeward author 2/27/2007

Hi,
Thank for your prompt reply.
Inserted the now() expression into Edit Page | register_date: "Edit as" settings dialog box for _sampletable
Following 'Build' | publish via FTP | I registered a new user, logged in & selected 'sampletable'

Again, the field is empty and the database show NULL.
modified_date now populated .... Thanks
Please HELP
Jane

J
Jane 2/27/2007

Jane,
please make sure that register_date field is on the Register page.

J
Janeward author 2/28/2007

Jane,

please make sure that register_date field is on the Register page.


Hi,
Not sure what you are asking for?

Are you asking me to add the register_date field in the Visual Editor | Register Page | Design area - if so how is this done?
Sorry if i seem a little confused.
Let me explain what i'm trying to achieve...
Simply, the user registers there login details, then logs in.

They will then be presented with the "List Page" At this point the user will only see there username & ID. They cannot add a new record. At this point I want the "register_date" field to display the current date (which will never change)

User then Logs out
Please HELP!!!
Jane

J
Janeward author 2/28/2007



Hi,
Not sure what you are asking for?

Are you asking me to add the register_date field in the Visual Editor | Register Page | Design area - if so how is this done?
Sorry if i seem a little confused.
Let me explain what i'm trying to achieve...
Simply, the user registers there login details, then logs in.

They will then be presented with the "List Page" At this point the user will only see there username & ID. They cannot add a new record. At this point I want the "register_date" field to display the current date (which will never change)

User then Logs out
Please HELP!!!
Jane


Hi Can anybody HELP <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=15907&image=1&table=forumreplies' class='bbc_emoticon' alt=':(' />

Alexey admin 3/1/2007

Jane,
to add a field to Register page proceed to Securty tab ->User Login settings -> Choose fields..

Add register_datethere then double-click it in Visual Editor and put the following into Default value box:

now()

J
Janeward author 3/3/2007

Hi Alexey,
Thank you for your help.
Carried out your instruction and good news .... it works.
However, I do not want the users to see the 'register_date' field selection on the 'Registration Page'. Is there any way to hide this.
Thanks in advance
Jane

J
Jane 3/5/2007

Jane,
there are two solutions of this issue:

  • you can set up this field as Readonly on the Register page on the "Edit as" settings dialog on the Visual Editor tab.
  • or you can set up default value of this field in the database directly.