guerre64
|
| Posted: 01/31/2005, 3:56 AM |
|
Hi there.
I'm trying to do something fairly simple in retrieving a text value that matches a numeric identifier in the same table of a database, using the CCDLookup function.
My current code is as follows:
global $DBpepperbox;
global $product2;
$result = CCDLookUp("composername", "composer", "composerid", $DBpepperbox);
$result = strval($result);
$product2->composerid->SetValue($result);
My problem is that I can't quite figure out the syntax/wording of the WHERE criteria. My table - composer - has "composername" and "composerid" and I want to be able to display the composername text value in my resulting page rather than the composerid numeric value.
Any assistance appreciated.
Cheers.
Guerre.
|
|
|
 |
mamboBROWN
Posts: 1713
|
| Posted: 01/31/2005, 6:08 AM |
|
What is the name of the field with the actual composerid? Let's call it composerid for this example. You should have two fields for this to work properly. You should have an hidden field (composerid) and a visible field (like Label1).
What is the name of the data grid? Let's call it NewGrid1.
What is the name of the field that will display the composername in text? Let's call it Label1.
This is how the statement should read:
$result=CCDLookUp("composername","composer","composerid=".$NewGrid1->composerid->GetValue(),$DBpepperbox)
Here is the link to the codecharge userguide (as a guide): http://docs.codecharge.com/studio/html/QuickStart/Creat...ntPage.html?toc
Hopefully this will be helpful.
|
 |
 |
guerre64
|
| Posted: 01/31/2005, 2:27 PM |
|
Cheers mamboBROWN - that was exactly what I was looking for - couldn't quite figure it out as I'm pretty new to php - your solution helped me brilliantly.
Thanks again.
|
|
|
 |
|