I have been working on a script long enough to decide that I am now officially frustrated. For some reason this chunk of the script will not display things properly...either it leaves off results, does not display proper URLs, or it leaves off links.

I don't know why and I can not figure it out, if anyone can help that'd be greatly appreciated.

PHP Code:
elseif ($do == "list")
{
    
$artist_name $_POST['artist_name'];
    
$query "SELECT * FROM Assigns WHERE Username='" $artist_name "'";    
    
$resulta mysql_query($query);
    
$num mysql_num_rows($result);
    
$xn 0;
    
    while (
$x mysql_fetch_array($resulta))
    {    
        echo 
"<strong>" $x['File Name'] . "</strong><br /><a href=" "uploads/" $artist_name "/" $x['Directory'] . "/" $x['File Name'] . ">Download This Model</a>";
        
        if (
$x['HasImage'] == yes)
        {
            
$query_images "SELECT * FROM Images WHERE Username='" $artist_name "' AND Directory='" mysql_result($result$x"Directory") . "'";
            
$result_images mysql_query($query_images);
            
            echo 
"<br /><a href=" "uploads/" $artist_name "/" $x['Directory'] . "/" mysql_result($result_images$xn"Image Assigned") . ">View Image</a><hr>";
        }
        else
        {
            echo 
"<hr>";
        }
        
        
$x++;
        
$xn++;
    }