I’m specifically looking to extend the PDO object somehow to add an internal counter every time a query is executed. I want to do this in a way were I wouldn’t have to change any of my existing queries or add an extra function like this suggests.
I not that familiar with classes or the PDO class in particular, but could this be done? How would I go about this?
I’m thinking extend query and execute and increment a stored variable each time they’re called.
Extending
PDOwould be done like any other class. Would this suit your needs? The only other code change would be having to instantiate this class instead of thePDOclass when making your initial connection.