[FX.php List] What is your approach to queries that receives an error?

Bob Patin bob at patin.com
Tue Nov 25 08:59:06 MST 2008


I have a script that I embed after every query:

// ERROR EMAILER
include_once('FX/error_emailer.php');
if (($existResult['errorCode']>0) and ($existResult['errorCode'] ! 
="401")){
	ErrorEmailer('<client name goes here>', 'index5.php', 'exist',  
$existResult['errorCode']);
}

and when an error occurs, I get an email message that looks like this:

PHP ERROR
Date of occurrence: 11/25/2008
Site name: <client name goes here>
Page name: index5.php
Query name: exist
Error code: 802 - Unable to open file

Since I started doing this about 8 months ago, it's been great for  
tracking errors without the client having to know that there was a  
problem in their site somewhere. This gives me the opportunity to go  
in, find out why the error occurred, and repair it.

Sometimes, as with the one above, bots apparently find their way to a  
page and try to load the page without having gone through the site,  
and I get strange errors like the 802 above, but generally it's been  
very useful.

If anyone wants the error_emailer page email me backchannel.

Bob Patin
Longterm Solutions LLC
bob at longtermsolutions.com
615-333-6858
http://www.longtermsolutions.com
iChat/AIM: bobpatin
FileMaker 9 Certified Developer
Member of FileMaker Business Alliance
--------------------------
FileMaker hosting and consulting for all versions of FileMaker
PHP • Full email services • Free DNS hosting • Colocation • Consulting

On Nov 25, 2008, at 7:34 AM, Gjermund Gusland Thorsen wrote:

> Personally I log them in a separate table.
>
> $q = new FX( $serverIP, $webCompanionPort, $dataSourceType );
> $q->SetDBData( 'www', 'phpFailedFXQuery' );
> $q->SetDBPassword( $webPW, $webUN );
> $q->AddDBParam( 'queryExecuted', $r['URL'] );
> $q->AddDBParam( 'errorCode', $r['errorCode'] );
> $q->AddDBParam( 'post', var_export( $_POST, true ) );
> $q->AddDBParam( 'get', var_export( $_GET, true ) );
> $q->AddDBParam( 'server', var_export( $_SERVER, true ) );
> $q->AddDBParam( 'cookie', var_export( $_COOKIE, true ) );
> $q->AddDBParam( 'session', var_export( $_SESSION, true ) );
> $r = $q->FMNew();
>
> And I have built a script to regenerate queryExecuted as a form for
> admin to rebuild the query, this is especially usefull for claims and
> orders.
>
> ggt667
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list



More information about the FX.php_List mailing list