Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8569423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:19:51+00:00 2026-06-11T18:19:51+00:00

I stated implementing object oriented design into my website. I’m using php, and ran

  • 0

I stated implementing object oriented design into my website. I’m using php, and ran into an issue.

As is my tendency, I like to define one class per one file – nothing else. Normally, if I remember correctly, in most languages classes can be called if they’re in the same directory without having to be explicitly linked to the main program (I could be wrong, or unique to virtual machines).

Right now, php sends errors when I don’t link the class file to the main file. On top of that, a child class won’t execute unless I define the link to the parent’s class file.

Do I have to explicitly link all of my files together?

Here’s some snippets of my code for detail:

<?php 



include_once 'VRC_Header2.php';
include_once 'UserService.php'; //Child class file of DB_MySQL.php
include_once 'DB_MySQL.php'; //Parent class
    //Without the two links above, this file will not execute

Then the child class:

class UserService extends DB_MySQL

{...

Any help is appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T18:19:52+00:00Added an answer on June 11, 2026 at 6:19 pm

    Yes, in PHP, you have to include all classes you need before you instanciate them.

    One method to circumvent this is to use autoloading:

    http://php.net/manual/en/language.oop5.autoload.php

    Which is used on most PHP Frameworks (e.g. Zend Framework).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to implement an AuditLog using the DBContext's ChangeTracker object, I ran into
We found this issue while implementing a reconnect logic for a WS endpoint using
I have started implementing Subscriptions into my app but I cannot get the API
I'm new to database design and I considering implementing something that will be time
I have a C++ state machine implemented using the State design pattern. Each state
I'm implementing an object cache: void cache(String request_type, String request_id, ProcessingStrategy request_strategy) { if
I'm looking at a tutorial for asp.net mvc here on the asp site: http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-basic-crud-functionality-with-the-entity-framework-in-asp-net-mvc-application
I am using protobuf for implementing a communication protocol between a Java application and
I want to define an abstract method like so: public abstract class Saveable {
I'm working on a game engine and working on implementing a state design. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.