I am trying to build my code more "compentized" where I can reuse it in other applications with ease however I cannot think of how to fix this problem. Say I have a file that has my database handling class in it, within that file, it calls a config_db file that has the values used to connect to the database. Now, if files would call from "there" server path everything would be fine but when you include a file it adds the code to the file calling it as if it were on that file therefore using the base path as the first calling file. I can set it up to work for one directory level and it works fine for any files within the same level or anyother folders that have the same level structure but if I try to add another subfolder to the working level (or go out a folder level) and call the sql file, my path within the sql file calling the db_config file is wrong. I just cannot think of how to work around this but I know there must be a way? I am hoping it is something simple I and I just can't figure out what it is. Is there a simple way to handle this problem? Or, how is this handled even if it is not simple? Thanks for any input.
That is just one example, I have other files that call other files within them. I am trying to avoid having to include 10 files on each page by only calling a couple which include there depent files automatically.