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