Australian Made and Owned

Returning the entire row of maximum value for each group (Group-wise Maximum in SQL / MySQL )

Posted July 8, 2010

NOTE: The content of this article is inaccurate and needs to be amended. If you wish to be notified when the update is made, you may subscribe via email.

Some SQLLast week I was joyfully hacking away at a project, progressing from from one task to another. Then it came time to do a non-trivial SQL query, though at the time I still thought the query would be nothing more than a select with a GROUP BY. I was wrong.

The Problem

What I wanted was to return the most recent log for each task for a particular user.

Here’s my table:
(more…)

Filed under: MySQL — Tags: , , , , , — Tim @ 12:01 pm

Check if Headers Have Already Been Sent in PHP

Posted July 22, 2009

Most PHP programmers would have come across this old chestnut before:
Cannot modify header information – headers already sent by page.php line 42

This can happen when you try doing a HTTP redirect or send HTTP 404, as it can happen whenever you try to send headers once they’ve already been sent. When a user sees this, they are basically left high and dry, often on a blank page. The solution is simple:
(more…)

Filed under: PHP,Troubleshooting — Tags: , , , , , — Tim @ 3:39 pm