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!
|
|
|
 |
|