email - Grab Warning and error messages and cast them in a variable with PHP -


i've got cron job , when run in terminal displays warning: warning: mysql_query() expects parameter 2 resource, boolean given in /dbcon.php on line 116.

i grab above text , put them variable can send email.

what have done this:

//debugging ...   if ($this->dbh === false) {       //get warning/error type.....       $error = error_reporting(e_error | e_warning);           //get script name...       $file = $_server['php_self'];        //get current file name...       $class = __file__;        //send email if connect() return false...       $this->process($error, $file, $class);             } 

however, $error sent email code. i've tried error_log() couldn't make work. had @ other sof 'similar' posts did not have success.


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -