DB Hoopla
How to burn a database in 3 steps...
Submitted by phrax on Thu, 2005-01-20 15:10. DB HooplaThanks to Au5lander for sending in this WTF he found on pastebin.com. I'm thinking that this might be some benchmarking code because it'll make the database work so hard!
The code basically goes like this:
- If record does not exist, insert data into the first column.
- If record exists, update the record with data for the second column
- Repeat for each additional column
- Watch database burn...
if, if, if, if, else, else, else, else...*sob*
Submitted by phrax on Thu, 2005-01-13 11:28. DB Hoopla | Fugly CodeMost of the WTF's I post here are submitted from the readers. Today I give you one from the code I have to maintain. In fact, I started The PHP WTF because of this code base. There are 'jewels' like today's example scattered all over the place. Today's example shone so brightly that I had to share it.
Curly braces are optional for simple IF/ELSE statements in PHP but there is a fine line between clear, concise code and a WTF. Today's code is perfectly valid but you'll probably stare at it trying to match the ELSE statements to the IF statements. I think this is what happens when your brain is screwed in backwards and you haven't learned about ELSEIF yet...