“Our God given unalienable rights are given to us all as individuals. They tell us what we may do for ourselves, and they are the embodiment of liberty.
The so-called rights that government gives to some of us are parcelled out to select groups as classes. They tell us what one class of people may require another to do for them, and they are the very essence of slavery.”— Perri Nelson, February 9, 2010
A bheil Gàidhlig agaibh?
Stupid developer tricks
Published Thu, Jan 22 2009 11:23 AM
Never, never execute an update SQL query without remembering to put in a WHERE clause. Or, if you're going to do something that bone-headed, be sure to have a recent backup of your data.
I just committed the bone-headed mistake mentioned above with my site database. For a few brief moments there, every comment on the site was the same. I even forgot to use my regular safety net of putting the update inside a transaction with a rollback to test it before actually committing the changes.
Fortunately for me, my hosting provider backs up my data daily. Today their customer support saved my bacon, and most of my data. I lost everything in the system since I replied to David's comments yesterday. I did lose a few of your comments, but I'll be restoring those as soon as I can.
And, yes Mr. Foley, if you're reading this, I'll remember to use WHERE clauses in the future.
Comments (5) | Trackbacks (0)

