Having trouble motivating myself today mainly cos I’m doing lots of boring tidy-up stuff and it’s a long weekend coming up!
Apostrophe Protection Society
Rockin' on without Microsoft
“It’s just software. You have to figure out what you need to do within your organization and then get the right stuff for that.”
PHP DB Error Reporting
I’ve been trying to improve the way we handle errors from a DB operation in PHP. We use ADODB for all our database access currently do stuff like:
$rs = $database->Execute($db)
or die($database->ErrorMsg() . "<br>" . $sql .
"<br>" . __FILE__ . " " . __LINE__)
Nothing wrong with this code, except that the die() statement has to be everywhere and if we ever want to change it, then we have to change it everywhere!
Looking through the docs for ADODB I discovered that if you include “adodb-errorhandler.inc.php” then if will report the error and die gracefully for you. However, it doesn’t tell you the file line number where the error happened. Having the file and line number where the error was generate is really useful, so I decided to fix the ADODB version. This turned out to be quite easy – all you need to do is use PHP’s debug_backtrace() to get the correct file and line number.
Having now implemented this, We can now write:
$rs = $database->Execute($db);
and know that if it fails, we’ll get a useful error message to debug from!
CSS
I’ve been trying to get the menu system used on http://www.britlore.co.uk to work on Opera and now realise why Cliff couldn’t get it working. Opera’s interpretation of the CSS “visibility” property seems to be fundermentally broken!
Happy Birthday Ross!
One more year closer to old age :) Happy Birthday mate!
Travelling
I had to go to Swindon this morning for a meeting. The RAC travel planner said that it would take 1.5 hours to get there, so I allowed 1h 45m just in case. Of course it took just under an hour… Coming back took over 2 hours though, so I suppose, on average, it was right!
Well done!
Well done England!
The Mind Boggles
“The US military said that soldiers had mistaken Mazen Dana’s camera for a rocket propelled grenade launcher.”
It just beggars belief…
BBQ
We used our new barbeque last night for the first time. In time honoured tradition, this state of the art cooking machine was used to cook sausages! We were suitably impressed with how easy it all is with a gas barbeque and were soon eating sausages in a bap with onions. Even Jon enjoyed it so it must have been ok!