This assumes SQL LOWER() is equivalent to strtolower(). Is this guranteed?