CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 Greeting for the user (Resolved)

Print topic Send  topic

Author Message
saseow

Posts: 744
Posted: 10/14/2008, 9:13 AM

I am trying to show a greeting for the user on a page. e.g. 'Hello Trevor'.
I have put a label on the page and in the Before Show event of the label I have the following code:

$db = new clsDBhockey_stats();
global $f_name;

$sql= "select * from users WHERE ID = ".CCGetUserID();
$db->query($sql);
$db->next_record();
$f_name = $db->f("first_name");
$Container->$greeting->SetValue($f_name);

$db->close();

I get this error:
Catchable fatal error: Object of class clsControl could not be converted to string in

Any ideas?

Thanks.
View profile  Send private message
saseow

Posts: 744
Posted: 10/14/2008, 9:16 AM

No worries, I got it:

$greeting->SetValue($f_name);
View profile  Send private message
codebang

Posts: 74
Posted: 11/14/2008, 7:57 AM

Hello,

I really need to know what exactly was your error as i am working in the same issue.
I exactly have the same code you have written.

Thank you,

Salah Midhat.
View profile  Send private message
saseow

Posts: 744
Posted: 11/14/2008, 8:15 AM

Hi,
I placed a label on the page and in the Before Show event added the following custom code:

$db = new clsDByour_database();
global $f_name;

$sql= "select * from users_table WHERE ID = ".CCGetUserID();
$db->query($sql);
$db->next_record();
$f_name = $db->f("first_name");
$greeting->SetValue("Hello ".$f_name. ", nice of you to join us!");

$db->close();

And thats it.
View profile  Send private message
codebang

Posts: 74
Posted: 11/14/2008, 10:09 AM

im sorry....

it doesnt work..
Call to a member function SetValue()on a non object,, is the error..

any ideas..

thank you
View profile  Send private message
saseow

Posts: 744
Posted: 11/14/2008, 10:23 AM

Make sure that the label that you put on the page has the name 'greeting' or change the code to the name that you have given the label.
If the label is not in a form then this should work perfectly. If it is in a form. then use the syntax $Container->etc.etc.
View profile  Send private message
codebang

Posts: 74
Posted: 11/14/2008, 10:28 AM

Thanks so much. you made my day...


thank you .
Salah Hafiz
View profile  Send private message
mamboBROWN


Posts: 1713
Posted: 11/16/2008, 7:31 AM

saseow
Can you please add [SOLVED] or [RESOLVED] to your thread title. Thanks in advance.
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.

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.