CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 ccs problem

Print topic Send  topic

Author Message
wanaka
Posted: 05/05/2002, 6:43 PM

what is the equivalent for the following line in CCS

$last_value=dlookup("customer","cust_name",$compare);
Nicole
Posted: 05/07/2002, 1:43 AM

Hello,
if you look at common file you'll see that CCDLOOkUP() function requires 4 parameters. The last one is db connection. To be able to use CCDlookUP() in custom event, you should open connection first, e.g.:
$dbl = new clsDB<connection_name>();
$last_value = ("lookup_field_name", "table_name", "where_clause", $dbl);
Jean-Michel
Posted: 08/09/2002, 4:41 PM

Thanks Nicole, I had the problem and your post helped me a lot.

In use the CCDLookup function in a header page having no class defined, to retrieve the first and last name of the logged user, accessing a user table with a where clause on the session UserLogin. The problem was that, some pages including this header did not use the connection accessing the database where the users table is stored, so when the header page was loaded I was getting an error because the connection object instance had not been created.

I solved the problem by adding lines 3 and 4 to my code:

1 global $my_data_connection_object;
2 ...
3 if(!is_object($my_data_connection_object))
4 $my_data_connection_object = new clsDB<connection_name>();
5 ...
6 CCDLookup
7 ("last_name",
8 "members",
9 "member_login='".CCGetSession("UserLogin")."'",
10 $my_data_connection_object);

If $my_data_connection_name has been created by the calling page, the added code does nothing, if it has not it creates the instance of the connection object.

Hope it helps.

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.