CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Need to retrieve USERID

Print topic Send  topic

Author Message
Gianni
Posted: 04/25/2002, 3:14 AM

Hi,

I have to write a custom SQL string in the form properties
whose WHERE clause is based on the USERID.

Is there a predefined variable that contains the USERID so that
I can simply write something like

WHERE tbl_users.userid = '{userid}'

If not, how do I retrieve the USERID?

Many thanks.

Gianni
Alex Alexapolsky
Posted: 04/25/2002, 3:53 AM

in ASP , this way :

WHERE tbl_users.userid = " & session("UserID") & "

in PHP

WHERE tbl_users.userid = " . get_session("UserID") . "

but better do it by adding UserID var in Form Properties/Input tab
and set type to "session"
Gianni
Posted: 04/25/2002, 5:09 AM

Thank you Alex. I followed your suggestion adding UserID
in Input Params and it works just like as I wanted. Great!

Now I understand the meaning of that obscure "session" type.

Do you know where are session variables explained in detail?
On line help doesn't say much.

Thanks a lot.

Gianni
Nicole
Posted: 04/25/2002, 6:45 AM

Gianni,
CC creates two session variables only. These are:
UserID that is based on the value of primary key field of users table. You have selected it as 'Primary Key (usually user_id)' on Site->Properties->Security tab
- UserRights that is based on the value of the fields that you specify as Security Level field. You have selected it as 'Security Level field (optional)' on Site->Properties->Security tab

You can create custom session vars the same way in any CC event.
Gianni
Posted: 08/19/2002, 3:16 AM

>WHERE tbl_users.userid = " & session("UserID") & "

I need to translate the sentence in JSP, so I entered

WHERE tbl_users.userid = " + getParam (request, "UserID") + "

and I get the following error:

Invalid SQL query.
Error: [IBM][CLI Diver][DB2/LINUX]sql0104N: An unexpected token "UserID" was found following "getParam (request, "". Expected token may include: "CONCAT". SQLSTATE=42601

How can I correct it?

Thank you very much.

Gianni

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.