As usual, TIMTOWTDI, but this would work:
Code:
$sth = $dbh->prepare ("SELECT date, nick, msg FROM msgs");
$sth->execute();
while( $date, $nick, $msg) = $sth-fetchrow() )
{
$info{$nick} = [ $date, $msg ];
}
creates a hash keyed on nick. Depends what you want to do with the data really.
The "while()" line could be
while( @p_info = $sth->fetchrow() )
for the same SQL as I've used.... and do some thing different with the hash assignment line...

HTH