CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 Displaying Session and DB values on Page

Print topic Send  topic

Author Message
Jer

Posts: 25
Posted: 03/09/2008, 6:34 PM

HI,

I've purchased CCS 4 after years of using CodeCharge 1. A few things that were simple on CC1 are causing me problems with CCS 4. I've checked the manuals but I'm not finding what I'm looking for.

I simply want to to display the UserID and the user's first name in the header.

My question is, how do i display the User ID, and how can I lookup and display the first name?

Thanks,

Jer
View profile  Send private message
wkempees


Posts: 1679
Posted: 03/09/2008, 7:19 PM

Helpfile:
CCGetUserID(), retreives userid from session, current logged in user.
CCDLookUp(), structured lookup
OR
Properties of the label, Action DlookUp

_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
Jer

Posts: 25
Posted: 03/10/2008, 12:36 AM

Thanks but I'm still having problems.

I set up a Form label. Then "Before Show" I choose an action of "Call Function."

I put in CCGetUserID() and got an error. Then I used CCGetUserID. The problem is nothing displayed.

This is driving me crazy.

Jer
View profile  Send private message
Jer

Posts: 25
Posted: 03/10/2008, 12:46 AM

For the dlookup, for the criteria I'm trying to have id=USERIDVALUE. For now I hard coded an id of 77.

The code that CodeCharge creates is:

$ccs_result = CCDLookUp(first_name, users, id='77', $Page->Connections["InternetMySQL"]);

the line above is line 34.

When I run the program, I get he error "Parse error: syntax error, unexpected '=' in C:\wamp\www\test\member\header_events.php on line 34"

If I change the code manually to

$ccs_result = CCDLookUp(first_name, users, "id='77'", $Page->Connections["InternetMySQL"]);

it works.
Jer
View profile  Send private message
wkempees
Posted: 03/10/2008, 3:21 AM

Quote :
> For the dlookup, for the criteria I'm trying to have id=USERIDVALUE. For
> now I
> hard coded an id of 77.
>
> The code that is created is:
>
> $ccs_result = CCDLookUp(first_name, users, id='77',
> $Page->Connections["InternetMySQL"]);
>
> the line above is line 34.
>
> When I run the program, I get he error "Parse error: syntax error,
> unexpected
> '=' in C:\wamp\www\test\member\header_events.php on line 34"
>

  
$ccs_result = CCDLookUp('first_name', 'users', 'id=77',   
$Page->Connections["InternetMySQL"]);  

real code would be:

  
$ccs_result = CCDLookUp('first_name', 'users', 'id=' . CCGetUserID(),   
$Page->Connections["InternetMySQL"]);  

Walter

wkempees


Posts: 1679
Posted: 03/10/2008, 4:24 AM

Quote :
> I set up a Form label. Then "Before Show" I choose an action of "Call
> Function."
>
> I put in CCGetUserID() and got an error. Then I used CCGetUserID. The problem
> is nothing displayed.
>
> This is driving me crazy.
>

BeforeShow

$Component->SetValue(CCGetUserID());

OR even simpler:
In Design, put cursor on the created label, look at the properties (right lower pane)
You'll see Default Value make it: CCGetUserID()

This is of course (!) assuming you have security set and are logged in.

Walter

_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
Jer

Posts: 25
Posted: 03/10/2008, 3:12 PM

Thank you. I've been able to get it working.

Jer
View profile  Send private message

Add new topic Subscribe to topic   


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

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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