CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 fatal error - member function on a non-object in

Print topic Send  topic

Author Message
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;
> > }
> >
> >
> >
>
>


   


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.