CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 Unable to retrieve value from CCDLookUp

Print topic Send  topic

Author Message
aldrin151

Posts: 11
Posted: 11/03/2008, 8:18 PM

Hey guys, I am going insane trying to retrieve a value from a simple DLookUP. I'm new to studio version. I've tried everything and can't get it to work! Can someone help, I really appreciate it?

$db = new clsDBInternetDB();

$moo = "1";

$Header->hello->SetValue(CCDLookUp("users","last_name","user_id=". $db->ToSql($moo,ccsInteger), $db));


or

global $DBInternetDB

$moo = "1";

$Header->hello->SetValue(CCDLookUp("users","last_name","user_id=". $DBInternetDB->ToSql($moo,ccsInteger), $DBInternetDB));
View profile  Send private message
melvyn


Posts: 333
Posted: 11/03/2008, 10:06 PM

Welcome to CCS world

Tell me a thing:
Are you trying to retrieve last_name from table users?
If so, then CCDLookUp("last_name","users"....

CCDLookUp() syntax is:

CCDLookUp("field","table","where condition",$connection)


_________________
Melvyn Perez
Puro Codigo
http://purocodigo.com
View profile  Send private message
DonP
Posted: 11/03/2008, 10:13 PM

I don't see anything wrong off-hand but first check to be sure that your
project has a connection called InternetDB. If it does, that part is
correct and if the page is using the connection already, you don't need
to redeclare it. If so, try:

  
global $DBInternetDB;  
  
// If the page is not using the connection already, then you will need   
to open a new connection as you did:  
  
$DBInternetDB  = new clsDBInternetDB;  
  
// Since it's an integer in the WHERE clause, I can see no reason to   
complicate it by using a second CCS function so try:  
  
$moo = 1;  
  
$Header->hello->SetValue(CCDLookUp("users","last_name","user_id=".$moo,   
$DBInternetDB));  

If this is being used as a label, be sure that the label property is set
to Text rather than Integer as it appears you are trying to get a name.
If set to integer, it will give no results as it is.

Don (DonP)

aldrin151 wrote:
> Hey guys, I am going insane trying to retrieve a value from a simple DLookUP.
> I'm new to studio version. I've tried everything and can't get it to work! Can
> someone help, I really appreciate it?
>
> $db = new clsDBInternetDB();
>
> $moo = "1";
>
> $Header->hello->SetValue(CCDLookUp("users","last_name","user_id=".
> $db->ToSql($moo,ccsInteger), $db));
>
>
> or
>
> global $DBInternetDB
>
> $moo = "1";
>
> $Header->hello->SetValue(CCDLookUp("users","last_name","user_id=".
> $DBInternetDB->ToSql($moo,ccsInteger), $DBInternetDB));
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
aldrin151

Posts: 11
Posted: 11/03/2008, 10:34 PM

:-D :-D :-D :-D :-D :-D :-D :-D :-D Melvyn....for two days I've been struggling, almost went blind...just because I had the field, and table reversed ... I feel like an idiot!

LOL .... I came off using codecharge 2.0 for almost 8 years so I'm so used to the dlook clause where table is declared first...

Thanks so much!
View profile  Send private message
mamboBROWN


Posts: 1713
Posted: 11/04/2008, 4:58 AM

aldrin151
Please be sure to add [RESOLVED] or [SOLVED] to your forum titlte. Thanks
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.

MS Access to Web

Convert MS Access to Web.
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.