No WHERE Clause

It has long been my contention that a WHERE clause on a SQL statement should be mandatory. Even if it just forces the programmer to add “WHERE TRUE” to the end of the statement.

This site is currently a prime example of why a mandatory WHERE clause would be A Good Thing(tm): my new “edit story” page has just run an update with no WHERE clause and set every story to be exactly the same. If its fixed when you read this, that’s because I’ve got to my laptop and done a restore.

Of course, this is also an illustration of the fact that every web site needs a development version. I do have one, its just on my laptop and that’s not here right now!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.