Archive for the ‘WTFs’ Category
-
The PHP Approach to Handling Race Conditions
Well, I know this isn’t thedailywtf, but coming across this WTF, I just had to share it. Apparently, if you want to know the value of the auto_increment field value from your latest MySQL INSERT statement, you have to make sure you ask for it really quickly,
“Note: Because mysql_insert_id() acts on the last performed query, be sure to call mysql_insert_id() immediately after the query that generates the value.”
Well, I guess that’s one way to avoid a possible race condition… If you’re retarded
Categories
- Climate (2)
- Music (2)
- Off the record (57)
- Poems (1)
- Politics (6)
- Portfolio (7)
- Psychology, Sociology, You & Me (4)
- Reviews (20)
- Movies (11)
- Restaurants (2)
- Series (1)
- Software (4)
- Tech Stuff (39)
- Travels (14)
- South Korea 2007 (13)
- Videos (7)
Recent Posts
- Marry Me
- A New Coat of Chrome Just Hit My Desktop
- Pretty Fonts in VMware Player and Workstation
- Ruby 1.9.2 on Ubuntu/Mint with no Fuss and no Muss
- Be Gone, Stupid Aptana Studio 3 Folders in My Home Folder