Running PHP 4.3.1 on RedHat8.
I've been banging my head on a wall trying to figure this one out. I've got a modular web hosting system, with a bunch of clients. I need a database driven error logger to keep better track of errors with the deployed modules used by multiple clients.
The goal: If an error already existed (by matching the $errno, $error, $file & $line) I'll increment a Quantity column. If it doesn't exist, I'll insert a new record.
I got it working as a function, but not in a class. That one still elludes me. I had to hard code the $db_conn variables inside the function to get the database to open & close. This is a completely worthless solution for scaling with clients but it does work for today. On to tomorrow.
One problem is I can't figure out how to encapsulate the error_handler in a class and call it: set_error_handler('$errorHandler->set_error_handler'), or something like that. Of course this doesn't work. And I need to open and close a database connection with each update or insert (especially if there are multiple errors on a page). But I can't figure out how to pass the $db_conn object (open & close connection methods) & the set_error_handler variables not just to a function but to one buried in a class.
Thanks.