birdie185
|
| Posted: 06/20/2002, 2:48 PM |
|
Fatal error: Call to a member function on a non-object in - is the message
cant figure out how to print out global variables.
the error is generated from this line below
==========================
$current_menu = CCDLookUp("menu_level", "menu", "id="
..$Connection1->ToSQL($current_record,ccsInteger), $Connection1);
this is the entire function below
======================
function Page_AfterInitialize() { //Page_AfterInitialize @1-56434BCA
//Custom Code @102-2A29BDB7
// -------------------------
// Write your own code here.
// -------------------------
global $content;
global $content_menu_two;
global $Redirect;
global $Connection1;
$current_record = CCGetParam("id","");
$current_menu = CCDLookUp("menu_level", "menu", "id="
..$Connection1->ToSQL($current_record,ccsInteger), $Connection1);
if($current_record==0)
$Redirect = "Home.php?id=1";
if ($current_menu==3){
$content_menu_two->Visible = False;
}
|
|
|
 |
Simon Chee
|
| Posted: 06/20/2002, 11:32 PM |
|
Hi
What is $Connection1 (what type) it need to be clsDB<> if it is an instance
of clsDB<> then I've no idea :)
This should work though
global $content;
global $content_menu_two;
global $Redirect;
global $Connection1;
$db= new clsDB<your db>;
$current_record = CCGetParam("id","");
$current_menu = CCDLookUp("menu_level", "menu",
"id=".$db->ToSQL($current_record,ccsInteger), $db);
if($current_record==0)
$Redirect = "Home.php?id=1";
if ($current_menu==3){
$content_menu_two->Visible = False;
}
"birdie185" <birdie185@home.com> wrote in message
news:aetika$i52$1@news.codecharge.com...
> Fatal error: Call to a member function on a non-object in - is the message
>
> cant figure out how to print out global variables.
>
> the error is generated from this line below
> ==========================
> $current_menu = CCDLookUp("menu_level", "menu", "id="
> .$Connection1->ToSQL($current_record,ccsInteger), $Connection1);
>
>
> this is the entire function below
> ======================
>
> function Page_AfterInitialize() { //Page_AfterInitialize @1-56434BCA
>
> //Custom Code @102-2A29BDB7
> // -------------------------
> // Write your own code here.
> // -------------------------
>
> global $content;
> global $content_menu_two;
> global $Redirect;
> global $Connection1;
>
> $current_record = CCGetParam("id","");
> $current_menu = CCDLookUp("menu_level", "menu", "id="
> .$Connection1->ToSQL($current_record,ccsInteger), $Connection1);
> if($current_record==0)
> $Redirect = "Home.php?id=1";
> if ($current_menu==3){
> $content_menu_two->Visible = False;
> }
>
>
>
|
|
|
 |
Simon Chee
|
| Posted: 06/20/2002, 11:39 PM |
|
ps
If your connection is called Connection1 then the db class will be called
$DBConnection1
global $DBConnection1
$current_menu = CCDLookUp("menu_level",
"menu","id=".$DBConnection1->ToSQL($current_record,ccsInteger),
$DBConnection1);
"Simon Chee" <darkblade@darkblade.fslife.co.uk> wrote in message
news:aeuham$5c6$1@news.codecharge.com...
> Hi
>
> What is $Connection1 (what type) it need to be clsDB<> if it is an
instance
> of clsDB<> then I've no idea :)
>
>
> This should work though
>
> global $content;
> global $content_menu_two;
> global $Redirect;
> global $Connection1;
>
> $db= new clsDB<your db>;
>
> $current_record = CCGetParam("id","");
> $current_menu = CCDLookUp("menu_level", "menu",
> "id=".$db->ToSQL($current_record,ccsInteger), $db);
> if($current_record==0)
> $Redirect = "Home.php?id=1";
> if ($current_menu==3){
> $content_menu_two->Visible = False;
> }
>
>
>
>
>
> "birdie185" <birdie185@home.com> wrote in message
>news:aetika$i52$1@news.codecharge.com...
> > Fatal error: Call to a member function on a non-object in - is the
message
> >
> > cant figure out how to print out global variables.
> >
> > the error is generated from this line below
> > ==========================
> > $current_menu = CCDLookUp("menu_level", "menu", "id="
> > .$Connection1->ToSQL($current_record,ccsInteger), $Connection1);
> >
> >
> > this is the entire function below
> > ======================
> >
> > function Page_AfterInitialize() { //Page_AfterInitialize @1-56434BCA
> >
> > //Custom Code @102-2A29BDB7
> > // -------------------------
> > // Write your own code here.
> > // -------------------------
> >
> > global $content;
> > global $content_menu_two;
> > global $Redirect;
> > global $Connection1;
> >
> > $current_record = CCGetParam("id","");
> > $current_menu = CCDLookUp("menu_level", "menu", "id="
> > .$Connection1->ToSQL($current_record,ccsInteger), $Connection1);
> > if($current_record==0)
> > $Redirect = "Home.php?id=1";
> > if ($current_menu==3){
> > $content_menu_two->Visible = False;
> > }
> >
> >
> >
>
>
|
|
|
 |
|