CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> Archive -> GotoCode Archive

 CCDLookUp with PostgreSQL

Print topic Send  topic

Author Message
bcschnei
Posted: 04/03/2003, 5:22 PM

I am having an issue where I am trying to use the following code to display the user's name in a label on the page header.

function Header_BeforeShow() {
global $Header;
global $DBConnection1;

$Header->UserName->SetValue(CCDLookUp("user_name","users","user_id=".CCGetUserID(), $DBConnection1) );

}

The problem is, PostgreSQL wants single quotes around the user_id, otherwise it returns the following error:

PostgreSQL said: ERROR: Attribute 'bcschnei' not found
Your query:
select firstname from users where userid=bcschnei

If I run the sql manually and add in the single quotes it works fine.

Anyone have any idea how to get around this?

Thanks,
Ben

RonB
Posted: 04/04/2003, 2:59 AM

$Header->UserName->SetValue(CCDLookUp("user_name","users","user_id=".CCToSQL(CCGetUserID(),ccsText), $DBConnection1) );

Ron
bcschnei
Posted: 04/04/2003, 1:08 PM

Works great!

Thanks Ron!

   


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.