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

 CCDLookup using a session variable in the where statement

Print topic Send  topic

Author Message
blasalle

Posts: 69
Posted: 12/11/2008, 4:44 PM

I want use CCDLookup in the BeforeShow event to populate a field. What is the PHP syntax to do this?

The field I want to populate is consent_date
The table I want to retrieve the value from is screening
The field I want to retrieve the data from is scrn_24 and the datatype for both fields (screen_date and scrn_24) is date

thanks

bernie
_________________
Bernie
University of Utah
Salt Lake City, UT USA
View profile  Send private message
maxhugen

Posts: 272
Posted: 12/14/2008, 7:52 PM

Did you look up Help on CCDLookup()? It's quite straight forward....

$myDB = new clsDBconnection;  // change to the name of your connection object  
$myVar = CCDLookup("scrn_24","screening",[your criteria here],$myDB);  
$myDB->close();

_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com
View profile  Send private message
maxhugen

Posts: 272
Posted: 12/14/2008, 9:58 PM

Quote :
Actually, I have spent a fair amount of time in the Help files and documentation. I should be more specific with my question(s). I have gotten the initial lookup to work just fine when I use a static term in the search criteria. What I really need to do is use a session variable as part of the where term. So far this has not worked. The current syntax for the search criteria is:

"screening_id = " . CCGetSession("TempScreen")

this does not cause an error but it does not return a value from the data either.

It sounds like your session variable has not been stored to the session?

You could test it by using echo, eg:

echo ("TempScreen: " . CCGetSession("TempScreen") );

_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com
View profile  Send private message
blasalle

Posts: 69
Posted: 12/15/2008, 9:21 AM

Resolved. This turned out to be a syntax issue when using a session variable in the 'Criteria' input of DLookup. In this case the correct way is: "screening_id = " . CCGetSession("TempScreen")

This results in the correct SQL WHERE statement being constructed.
_________________
Bernie
University of Utah
Salt Lake City, UT USA
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.