Is it possible to overload a function, but still call it?
I want to extend PHP $mysqli->query, where I want to keep a log of the SQL queries used, but then still carry it out, so I know I need to extend the mysqli class, but would like to either disable the ->query in my extended class (so it cant be called), but then in my ->query2 still call the ->query function.
What Ive got soo far which I think is along the right lines is:-
class MySQLi2 extends MySQLi
public function query ($query)
parent::query ("insert into `logger` (`sqlCode`) VALUES ('" . mysql_real_escape_string($query) . "')");
return parent::query ($query);
Ive only found a few documented sources of using parent:: so think Im using it wrongly.
Any ideas what Im doing wrong?