practical web design & development

Archive for the ‘Database’ Category

From time to time when querying the database, you have to break the mold. CakePHP gives many options when it comes to complex conditions, but sometimes you need to push the boundaries. Recently I needed to return a subquery as a field name. It wasn’t a high demand query, so I wasn’t too concerned with [...]

Postgres Gets JSON Type in 9.2

Pretty exciting news that Postgres will be getting a JSON type in 9.2. I have to admit I rarely stray from the standard numeric, string, and timestamps, but this could be very useful. I could see this being used similiar to how some setups serialize php sessions for database storage. JSON could provide a more [...]

A while back I discussed how to use the new sqlsrv extension for php to retrieve multiple result sets at a time from stored proceedures. This was indeed helpful when you need to retrieve related data and avoid multiple calls to stored proceedures. The down side is this was using a rather expensive (but good) [...]

The web is a global resource for anything, anywhere, any timezone. But often times we are careless in consideration for people in other areas of the world. The different timezones offset people’s schedules from one area to the next. When handling user profiles (or anything for that matter) where date and time is involved we [...]

I thought of another handy scenario for using regular expressions in Postgres. This time not within the conditions, but in the returned results. Lets say for instance you have a column with URL, (maybe blog comments or something) and you would like to get a list of all the domain names, not the full paths [...]