If I define the connection parameters for my database class in the database class itself, every reuse of the class would need changements in the class itself.
If you hardcode it, yes.
But you dont have to.
Consider a hypothetical database abstraction layer that merely caters for MySQL databases (so isnt much of an abstraction layer, actually), and does no error checking:
class MysqlDB {
var $link;
function MysqlDB($host, $name, $pass, $database) {
$this->link = mysql_connect($host, $name, $pass);
mysql_select_db($database, $link);
}
function query($query_str) {
return mysql_query($query_str, $this->link);
}
}
You can then instantiate different databases, for different scripts.
Actually, the only really useful thing about this class would be that it helps you manage using multiple databases simultaneously, but that's besides the point.
Another problem with your solution: creating an instance of the db class from an include file would work great but would require me to use $GLOBALS['db'] for example trough all of my A and B class
It doesnt.
You have to understand the nature of variabes in included files to know why.
I suspect that more canonical OOP would use inheritance, i.e. classes that need database handling would be derived from the database class.
I'm more comfortable with using a database object within such classes.