Category Archives: Databases

December 13, 2008
Development configuration tips for Ubuntu– also posted in Apache/IIS, PHP, SVN, Ubuntu, cfeclipse

I just setup my machine at home with Ubuntu 8.10 (desktop) which was so easy think I saved hours off the time it would normally take with Windows. So much is already installed and ready to go and with apt (or the Synaptic package manager) it’s super quick to download and install extra things things [...]

December 3, 2008
Querying multiple databases within one cfquery– also posted in ColdFusion

In discussing a possible caching solution at work a suggestion was made to use a secondary database (on the same server) to store some key application data. It’s not really important to describe why we wanted to do this, suffice to say that my concern was if and when the application would need to perform [...]

November 22, 2008
cfqueryparam does not work in ORDER BY, what are my options?– also posted in ColdFusion

For those that don’t know, ColdFusion’s cfqueryparam won’t work on a SQL ORDER BY clause, so the following will not work:

<cfquery name="qGetUsers" datasource="mydsn">
SELECT FirstName, LastName
FROM Users
ORDER BY <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.order#" />
</cfquery>

This is really nothing new, people have been talking about this for years but with the spate of recent SQL injection attacks (note that I meant to [...]

November 19, 2008
Logging all MySQL queries on Mac OSX

We’ve been doing some debugging of a 3rd party application recently where we had some possible performance concerns under a certain load and/or size of data in the database. What we wanted to know was exactly which queries (and how many) where hitting the database on a specific page request.
The simplest method was to turn [...]

October 27, 2008
Fun with reserved words in MySQL 5

Most tools or languages you work with have words which are “reserved”, meaning you cannot use them in a variable declaration or schema definition etc as they have special treatment in the underlying system. If you try to do this you’ll usually get an immediate error.
Today I needed to change an existing SQL query from [...]