wordpress / php get_attachment_url基于uid和post parent id

Still learning and feel like I am only a few steps away, so I appreciate your help!

Have multiple child posts that should each return an attachment url based on what that child post uploaded. Using an array to gather the attachments that were uploaded. I have somehow managed to get it working, but it returns all uploaded from that user, when i would like it to just return the most recent upload from that user. Any use of 'max' to accomplish this seems to kick out an error. The fifth line from the bottom is the trouble spot. I am using post_date to try and accomplish this, but i think ID would suffice as well. Thank you for any input your can provide.

            $exclude = array();

        $args = array(
            'order'          => 'ASC',
            'post_type'      => 'attachment',
            'post_mime_type' => 'image',
            'post_parent'    => $pid,
            'numberposts'    => -1,
            'post_status'    => null,
        );

        $attachments = get_posts($args);

        foreach($attachments as $att) $exclude[] = $att->ID;

        $args = array(
            'order'          => 'ASC',
            'post_type'      => 'attachment',
            'post_parent'    => $pid,
            'post_author'    => $uid,
            'ID'             => $pkey,
            'exclude'    => $exclude,
            'numberposts'    => -1,
            'post_status'    => null,
        );
        $attachments = get_posts($args);



        if(count($attachments) == 0) echo __('No project files.','ProjectTheme');

                    foreach($attachments as $at) {
                     if($at->post_author == $user->ID) {
                       if($at->post_parent == $row->pid) {
                           if($at->post_date == $at['max(post_date)']) {
                          $fileName = wp_get_attachment_url($at->ID);
                          echo '<div>'. mp3j_put('[mp3j track="' . $fileName . '" flip="y"]').'</div><br>';
                                         }}}}
                                          ;

I ended up using SQL to solve this via the solution below.

$audiolinks = "select ID, post_author, post_parent, max(post_date), guid
    from ".$wpdb->prefix."posts
    where post_author='$user->ID' AND post_parent ='$pid' order by id DESC";
$audiolink  = $wpdb->get_results($audiolinks);
$filelink = wp_get_attachment_url($audiolink[0]->ID);
$fileauthor = $user->user_login;
$filetitle = $post->post_title;
echo '<div style="padding-top: 10px">'
    . mp3j_put('[mp3j track="' . $filelink . '" title="Play Audition: '
    . $fileauthor . " - " . $post->post_title
    . '" flip="y"]').'</div><br>';