Speaking of MySQL, here is a segment of code that I find extremely useful and efficient for what it does (forgive the PHP 4)
$Query = 'SELECT * FROM table WHERE 1=1';
$mysql_Query = mysql_query($Query);
$i = 0;
while($Query_data = mysql_fetch_assoc($mysql_Query)) {
$mysql_array[$i] = $Query_data;
$i++;
}
Gets all the rows for a query as opposed to just one, as is done with mysql_fetch_assoc. I find it extremely awesome.