Penny for a FULL OUTER JOIN

October 9th, 2008

I’m working with an ACL and I would kill for MySQL to support FULL OUTER JOIN.  There are hacks to support something similar, but they would make my queries less pretty.

And pretty queries are important.

I hate array-fu

October 8th, 2008

I recently came across something of the form:

$allowed=array('foo','bar','baz');
foreach($stuff as $key => $value){
        if( array_search( $key ,$allowed ) ){

What they meant was:

$allowed=array('foo','bar','baz');
foreach($stuff as $key => $value){
        if( in_array( $key ,$allowed ) ){

I hate all the PHP array functions, partly because there are so many and I don’t recall many of them, and partly because that is the case with everyone else and they still use them. The first entry in the array will have a key of 0 which php will evaluate to false. Who really cares about foo anyways…

Motorcycle licence

October 5th, 2008

check.