1048576.com 2 to the 10th, squared!

16Apr/10Off

MySQL tip: UPDATE LIMIT 1

Here's one I picked this up a while ago, for those that rock mysql at the command line all day like I do:

master/wp> UPDATE user SET ad_id='fb' WHERE user_id = 1337 LIMIT 1;

It's a good way to ensure that if you seriously fcuk the query up, you only update 1 record. For multiple records, there's another good practice to get used to: do a SELECT first, using the same exact WHERE criteria you plan to use in your UPDATE statement. This verifies the set you will be affecting when you do run the UPDATE is indeed what you want to update, and you can plug the row count you get from it into your UPDATE's LIMIT clause.