[SOLVED] Show link to document problem -- help
Posted: Mon Feb 16, 2004 4:27 pm
I have the following code, that works, except that I want to show the link to the resume (if it exists). It, however only shows on the last entry of the results and not all results. What am I doing wrong.....pulling my hair out!!
Code: Select all
<?php
$query = "SELECT * from application ORDER by appID DESC";
$result = mysql_query($query)
or die ("could not execute query");
echo "<table>\n";
echo "<tr align="left"><th width="120"><font face="Verdana" size="1"><b>Applicant Name</b></font></th>
<th width="120"><font face="Verdana" size="1"><b>Position Applied</b></font></th>
<th width="120"><font face="Verdana" size="1"><b>Application</b></font></th>
<th width="120"><font face="Verdana" size="1"><b>Date</b></font></th>
<th width="80"><font face="Verdana" size="1"><b>Resume</b></font></th></tr>\n";
while ( $row = mysql_fetch_array($result))
{
extract($row);
echo "<tr>\n";
echo "<td width="120"><font face="Verdana" size="1">$first_name $last_name</font><br></td>\n";
echo "<td width="120"><font face="Verdana" size="1">$position_apply</font><br></td>\n";
echo "<td width="120"><font face="Verdana" size="1"><a href="../show_app.php?appID=$appID" target="_blank">view application</a></font><br></td>\n";
echo "<td width="120"><font face="Verdana" size="1">$date</font><br></td>\n";
}
if(!file_exists("../resume/".$first_name.$last_name.".doc")){
echo "<td width="80"><font face="Verdana" size="1"><a href="../resume/".$first_name.$last_name.".doc">Yes</a></font><br></td>\n";
} else {
echo "<td width="80"><font face="Verdana" size="1">No</font><br></td>\n";
}
echo "</tr></table>\n";
?>