Jump to content
Stef's Coding Community


New Members
  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About IndexOutOfBounds

  • Rank
    New member
  1. Hehe, yes it does. I tried using the global $core at my actual pages, failing to realize that global is a keyword used in classes (at least, that's what I think it is). So I got it working now like I originally wanted. Once again, thank you so much
  2. Aha, I see. Thanks a lot again! I've been searching around a bit while awaiting a response, and I stumbled across the Singleton concept. As far as I can make out, I could implement that into this? -- Edit: Hmm, feel like a idiot now, so you'll have to forgive me if I'm doing some elementary wrong here. I've created the core class as per your above post, and inserted the "global $core;" in the php-file I'm working on. However, when I try $core->DB->do_connect(); I get the error, "Call to a member function do_connect() on a non-object in C:\xampp\htdoc
  3. Thank you so much. Sorry if my first post was a bit confusing, when I read it trough now I saw that it wasn't entirely clear. I also noticed that I'm mixing between functions/methods and classes/objects ... .Anyway, I like the solution you provided, and particularly the last one. But I'm not quite sure what you mean by creating a object that contains other objects. Could you show me a simple example how I would go about doing this?
  4. Heya, so I've worked on PHP for a while, but only recently started to learn OOP. I've been following the tutorials here on killerphp, and started implementing OOP into a private project of mine. However, I've recently struck a bit of a problem which I assume is very easy to those of you that know OOP. So, the case: I've been creating a class that I've been using to connect to my DB. The connectdb -class contains two functions, one construct and one function that actually connects to the DB. All variables (with host information for the DB) are declared private inside the class.
  • Create New...