CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 CCDLookup

Print topic Send  topic

Author Message
swami

Posts: 54
Posted: 12/07/2007, 10:42 AM

I need to use ccdlookup to get a value and if the value is 2 i need it to redirect can anyone help me with this

global $Redirect;
if CCDLookUp("maintenance", "config", "2" );
$Redirect="index.php";
View profile  Send private message
DonP
Posted: 12/07/2007, 10:49 AM

The CCDLookUp() function requires a connection name and also your PHP syntax
is off a bit. If your grid or form already has a connection, you need to
refer to it:

global $DBconnection; // use your existing connection name in place of
"connection"
global $Redirect;

if (CCDLookUp("maintenance", "config", "2", $DBconnection )) {
$Redirect="index.php";
}

If there is no connection on the page, you'll have to open one first.

Don (DonP)

"swami" <swami@forum.codecharge> wrote in message
news:547599419900a7@news.codecharge.com...
>I need to use ccdlookup to get a value and if the value is 2 i need it to
> redirect can anyone help me with this
>
> global $Redirect;
> if CCDLookUp("maintenance", "config", "2" );
> $Redirect="index.php";
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.yessoftware.com/
>

swami

Posts: 54
Posted: 12/07/2007, 10:59 AM

thank you but it does not work and it is giving a error

global $localhost;
global $Redirect;
if (CCDLookUp("maintenance", "config", "2", $localhost )) {
$Redirect="maintenance.php";
}
View profile  Send private message
DonP
Posted: 12/07/2007, 11:07 AM

Could you be more specific? What type of event are you using for the code
and what is the error?

Don (DonP)

"swami" <swami@forum.codecharge> wrote in message
news:547599419900a7@news.codecharge.com...
>I need to use ccdlookup to get a value and if the value is 2 i need it to
> redirect can anyone help me with this
>
> global $Redirect;
> if CCDLookUp("maintenance", "config", "2" );
> $Redirect="index.php";
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.yessoftware.com/
>

DonP
Posted: 12/07/2007, 11:10 AM

One thing I see that I missed the first time is that "2" says nothing and
has no meaning to the function. "2" what? It needs to be a proper Where,
such as:

if (CCDLookUp("maintenance", "config", "ID=2", $DBconnection )) {
$Redirect="index.php";
}

Don (DonP)

"swami" <swami@forum.codecharge> wrote in message
news:547599419900a7@news.codecharge.com...
>I need to use ccdlookup to get a value and if the value is 2 i need it to
> redirect can anyone help me with this
>
> global $Redirect;
> if CCDLookUp("maintenance", "config", "2" );
> $Redirect="index.php";
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.yessoftware.com/
>

swami

Posts: 54
Posted: 12/07/2007, 11:15 AM

yes i had already tried it i get a error in my common


global $localhost;
global $Redirect;
if (CCDLookUp("maintenance", "config", "maintenance=2", $localhost )) {
$Redirect="maintenance.php";
}


Fatal error: Call to a member function on a non-object in /home/asa/public_html/Common.php on line 492

the record is called config

the field is called maintenance

the value in that field is 2
View profile  Send private message
swami

Posts: 54
Posted: 12/07/2007, 11:16 AM

i can change the value in that field from the admin if it is 2 then i want it to redirect if its 1 i dont want it to redirect i tried it on after intialize on page
View profile  Send private message
DonP
Posted: 12/07/2007, 11:23 AM

Your connection format is not a connection. It MUST be $DBconnection; with
"connection" being whatever your actual database connection is called.
"localhost" would be a very odd connection name. Full details about the
CCDLookUp() function and about connections can be found in the CCS Help
files.

Don (DonP)

> yes i had already tried it i get a error in my common
>
>
> global $localhost;
> global $Redirect;
> if (CCDLookUp("maintenance", "config", "maintenance=2", $localhost )) {
> $Redirect="maintenance.php";
> }
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.yessoftware.com/
>

swami

Posts: 54
Posted: 12/07/2007, 11:39 AM

ok don here is the problem i got it to work but if i try to include it and make it includable it give error but if its not includable it works
View profile  Send private message
DonP
Posted: 12/07/2007, 11:51 AM

If you include it, you'll very likely have to use the new connection syntax
which you can find in the CCS Help. The syntax is something like this:

$DBconnection = new clsDBconnection();

Place this above the CCDLookUp() function in your included event. As
before, "connection" is the name of your own connection. Using this syntax,
you do not need the global $DBconnection; line.

I am not sure if redirects work properly from an included page, though. It
seems to me I had trouble with that too at one point and I don't recall if I
ever solved it or not.

Don (DonP)

"swami" <swami@forum.codecharge> wrote in message
news:547599419900a7@news.codecharge.com...
> ok don here is the problem i got it to work but if i try to include it and
> make
> it includable it give error but if its not includable it works
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.yessoftware.com/
>


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.

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.