The trick is to never ever create include files that depend on eachother for funtionality.
The main script should use functions from the included files, but the included files should all work independantly.
IN the original example, the html.inc should never try to get it's data directly from database.inc.
Instead, the main script should load html.inc and database.inc, and then use their functions to get data from the database and to feed that data to the html functions.
I know that sounds like doing a lot of extra work, but it is worth it.
cross-dependancies make your include files useless. Every time you include html.inc in any script, you must include database.inc too.
Now what if your app does not work with a database? then you have to re-write your html.inc to read different data...