Archive | SQL RSS feed for this section

RE: ORM Haters: In Defense of ORMs

This article is in response to a discussion on hacker news regarding ORMs (or object-relational mapping) which is a programming technique where a database is abstracted into classes. Instead of writing SQL at the application level all database interaction is done through objects. There are many ORMs out there, to name just a few: Hibernate for [...]

2 Comments Continue Reading →

Installing LAMP Stack on OSX 10.7 Lion

This is a follow-up to my previous article on installing a LAMP Stack on Snow Leopard and explains the steps that you need to get Lion up and running for LAMP development.  (Linux, Apache, MySQL and PHP in case you don’t already know).  Lion comes pre-installed with Apache and PHP 5.3.6 so you only need [...]

10 Comments Continue Reading →

MySQL can’t specify target table for update in FROM clause

If you’re at this page you probably have encountered an error similar to “Error Code: 1093 You can’t specify target table ‘my_table’ for update in FROM clause” The reason for this error is that MySQL doesn’t allow updates to a table when you are also using that same table in an inner select as your [...]

14 Comments Continue Reading →

sqlite lpad and rpad functionality

sqlite is missing several basic database features compared to typical SQL servers and unfortunately padding is one of them.  For a most situations though, you can use a simple hack to get the same functionality.   This trick uses a combination of concatenation and substr: — the statement below is almost the same as — select [...]

3 Comments Continue Reading →

Installing LAMP stack on OSX 10.6 Snow Leopard

Updated instructions are available for installing LAMP on OSX 10.7 Lion. I’m setting up a new machine and found a great tutorial written by Josh Lockhart on getting a PHP web development environment up and running on Snow Leopard.  This goes through almost everything to be up and running for a typical LAMP stack with [...]

11 Comments Continue Reading →