With that said, let's look at the database class to see what it means. This line creates a new database object. Think of it as initializing all the functions in MyDBClass so that you can use them. In a real OO language, creating this object would simply allocate memory for the data and functions. To do anything useful with this object, you evoke methods on it.
Methods are simply functions that manipulate an object's data.
The query method takes the string you pass it, and uses the data in the database object to execute that query. In PHP, it means that the method on the right is called on the object on the left. Here, query is just one of the functions in the database class. All the other functions in that class can be accessed in the same way. Now, when you set up your local.inc file, you do so by extending classes.