As developers, we have a bunch of stupendous stories about the time spent debugging legacy code. This blog is designed to highlight some of the most annoying / interesting / hair-rising / hilarious solutions of the past.
Saturday, March 29, 2014
Query massacre
Wow! I got myself over the shock of facing another deprecated mysql_ function, but look at this construction:
for($i=0;$i<5;$i++){
$q[$i]=mysql_query("SELECT * FROM users LIMIT $i,1");
}
Uses a for loop to execute multiple queries selecting one line each instead of LIMIT 0,5. GENIUS.
No comments:
Post a Comment