This topic is locked
[SOLVED]

 append date to text field after exisitng data in edit pa

3/2/2010 4:06:21 PM
PHPRunner General questions
W
Wraith author

Hello. I am using PHPrunner 5.1 (2503).
I am creating a site that records incoming clients and their current status.
I have a text field "Notes" where people enter information about, and changes that happen regarding, the client.
Is there any way to add the current time to the end of the existing data in the text field when opening the edit page?
I have it working so that when a new clients is added, the date and time is auto matically added to this field by adding "now()" to the default field, but if I try this on any of the other pages, the existing text get replaced and only the current date and time is shown.
Thanks
Dave

Sergey Kornilov admin 3/2/2010

You can try something like this in BeforeAdd/BeforeEdit events:

$values["Notes"].="\n".now();
W
Wraith author 3/3/2010

Hello, thanks, tried that. I put the line into "Edit page: before display" but got
php error happened

Technical information

Error type 8

Error description Undefined variable: values

URL aawaitlist.odyssey.org.nz/Referral_edit.php?editid1=Ref&editid2=now

Error file C:\Inetpub\aawaitlist\include\Referral_events.php

Error line 37

SQL query SELECT client.First Name, client.Last Name, client.DOB, client.Gender, client.Referrer, client.Legal Status, client.Action, client.Notes, client.Clinician, client.Referral Status, client.Gambling, client.Meth, client.Referral Status Date Change FROM client INNER JOIN referal status ON client.Referral Status = referal status.Status INNER JOIN Action ON client.Action = Action.Action where (client.Action ='Open' AND client.Referral Status ='Referral' ) and ( (client.First Name<'Ref' or client.First Name IS NULL or client.First Name='Ref' and (client.Last Name<'now' or client.Last Name IS NULL ))) ORDER BY 1 DESC, 2 DESC limit 1

W
Wraith author 3/3/2010

Putting into "Before record updated" inserts the date at the end of the new text in the field, which is OK but not preferable.