This topic is locked
[SOLVED]

 (Question) How to get current logged user as default val

1/5/2010 3:56:03 AM
PHPRunner General questions
A
almonddgr8 author

Sorry guys I'm really a newbie so be gentle.
I have a main table were it has a field (Created by),
and a seperate login table were it has fields (userid, password, fullname).
Here's what I wanted to achieve:
-When a logged user adds a new record, I want to have a default value on the (Created by) field on my main table were it gets the (fullname) field from my seperate login table. So that all user who creates a new record would have an automatic value on their (Created by) field.
Thanks in advance guys.
I have a feeling this one is a piece of cake. But unfortunately I don't know the answer.

R
ringlis1 1/5/2010

You can add the following as the default value for the CREATED BY Field, as long as your using user logins
@$SESSION["" . $strTableName."_OwnerID"]

A
almonddgr8 author 1/5/2010



You can add the following as the default value for the CREATED BY Field, as long as your using user logins
@$SESSION["" . $strTableName."_OwnerID"]


Thanks for the reply, but I'm getting this:
PHP error happened

Technical information
Error type 8

Error description Undefined variable: str_dbase_user_login

J
Jane 1/7/2010

Hi,
do not replace strTableName with your actual table name in the sample code.

If it doesn't help publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.

A
almonddgr8 author 1/7/2010



Hi,
do not replace strTableName with your actual table name in the sample code.

If it doesn't help publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.


Thanks, got it! hehe