This topic is locked

auto-update fields

1/30/2011 7:15:29 PM
PHPRunner General questions
A
alesnap1 author

Hi all, i'm newbie in php so I have a question...

I have user table with different fields: user, password, store(selected by another table)

On articles add page I have user, store and articles details.

I want that, if i'm logged in as user X, the user_field and the store_field are auto-updated.

I tried with $_SESSION["OwnerID"] on user_field and it works, but i'm not able to update the store_field.

Anyone has an idea?
Thanks for help and sorry for my bad english!

A
alesnap1 author 1/31/2011

no ideas?

P
procheck 1/31/2011

Have you checked the permissions?

A
alesnap1 author 1/31/2011

No problem with permission.
I set user_field as lookup wizard with default value $_SESSION["OwnerID"] ->autofill store_field...

Then I tried to set the same way the store_field...but I have no text inside the field...

No problem with user_field...If i'm logged as user X, I see X in user_field...but nothing in store_field...

How can I do that?
Thank you

P
procheck 1/31/2011

I did something like this before but I can't remember exactly how I did it. I think once you've selected the user_field then the other fields would be updated in the events using the SQL Update based on the userid which you've chosen.
You can also update the values array in BeforeAdd
ie $values["FieldName"] = "yourvalue";