Jump to content

bigft

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

bigft's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I don't think I explained it to well, here's an example of what I'm trying to do: <?php class class1{ var $c2; var $c3; etc... . . } class class2{ function error($msg){ return $msg; etc.... } } class class3{ function query($sql){ return mysql_query($sql) or error('can\'t run query...'); } } $c1 = new class1; $c1->c2 = class2; $c1->c3 = class3; ?> What I'm trying to do is use the error function from class2, in class3. Also, I realized that I never extended the classes so I can't use the parent scope (well I think i can't anyways).
  2. Hey I've got a quick question regarding a OOP problem. The thing is, is that I have a main file (A), and it has two variables (B, and C) that both hold separate classes, class B is the mysql functions and class C is the error functions. What I need to know is how to access the error function in class C from class B. For example, (i know this is retarded), but in my mysql class, for the error display I have: mysql_query(......) or parent::C->SetError('omgawd....'); And I know this doesn't work, but it may set an example on what I'm looking for. Any help would be appreciated. edit ...(Crap sorry, didn't realize there was an OOP forum before posting)
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.