a
|
| Posted: 06/06/2002, 2:02 PM |
|
Anyone know how to use the second argument in the PHP Function CCGetDBValue?
CCGetDBValue($sql,$db)
The functions reference states to use the connection class for data retrieval.
Anyone have an example of this?
|
|
|
 |
DaveRexel
|
| Posted: 06/06/2002, 2:22 PM |
|
a (last name b?),
This is an extract of what YS sent me :
----------------
Dave,
please use following code in events to look up table value:
1.
global $<form_name>;
$new_obj = new clsDB<connection_name>();
$sql = "select category_desc from categories where category_id=". CCToSQL($<form_name>->item_id->Value, "Number");
$myLookup = CCGetDBValue($sql, $new_obj);
$<form_name>-><field_name>->SetValue($myLookup);
OR
2.
global $<form_name>;
$new_obj = new clsDB<connection_name>();
$res = CCDLookUp("lookup_field_name", "table_name", "id=".CCToSQL($<form_name>->item_id->Value, "Number"), $new_obj);
$<form_name>-><field_name>->SetValue();
Regards,
Helen
-----------------
Greetings,
Dave
|
|
|
 |
a b
|
| Posted: 06/06/2002, 2:29 PM |
|
Hey . Thanks. Your the man.
Pretty close to what I had already.
Sincerely,
a b
|
|
|
 |
|