NogDog wrote:You could just extend PDO and add any additional methods you want
I suggest that you don't do that unless:
You want to override some method in the PDO class (i.e., inheritance for polymorphism), or
You want a new class because you need to store one or more data members (hence merely extending the interface of the PDO class with a library of non-member functions will not suffice), or
You want to access a protected member of the PDO class (but there are none)
Otherwise, extending the interface of the PDO class with a library of non-member functions is superior as it allows different such libraries to be freely combined, whereas if you inherited merely to extend the interface when you didn't need to, and another person did the same, a third person wanting to use functionality from both would have to deal with multiple inheritance (but in this particular form, that's not available in PHP).
In NogDog's example, you could easily have a constructor function that is a wrapper for the PDO class constructor that does the same thing, and likewise doQuery merely needed a PDO parameter.
NZ_Kiwis wrote:I have this code, my error is in line 26 which is this "$stmt->exec($params);"
exec is a method belonging to the PDO class, not the PDOStatement class. You're looking for the execute method of the PDOStatement class instead.