Hi Community!
I have already searched the whole web about this Problem, and I didn't find anything. Maybe you can help...
I want to show the number of all SQL queries I executed to load a web page. It is a very complex system I programmed, and I don't want to count them manually. I use PDO for this, so I can't easily write a function count_query($sql)
which increases a counter and return query($sql)
I have already tried to write my an "myPDO"-class, extended from PDO, to do this job, but it didn't work.
class myPDO extends PDO{
var $myOwnCount =0;
public function __construct($location,$user,$pass)
{
parent::__construct($location,$user,$pass);
}
public function exec($q){
$this->myOwnCount ++;
return parent::exec($s);
}
public function query($q){
$this->myOwnCount ++;
return parent::query($s);
}
}
Gave those Errors:
Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\...\functions.php on line 52
Fatal error: Call to a member function fetch() on a non-object in C:\xampp\htdocs\...\index.php on line 69
Thanks for help
Paul