my $sql = "SELECT UID, MONTHNAME(PostDate), YEAR(PostDate) FROM news ORDER BY PostDate DESC"; my $sth = $dbh->prepare($sql) || die "Error preparing: $DBI::errstr"; $sth->execute || die "Error executing: $DBI::errstr"; $rv = $sth->bind_columns($UIDholder, $indexmonths, $indexyears);