witham Posted February 27, 2008 Share Posted February 27, 2008 Hi I am hoping someone out there can help me with the final piece to a php script I am creating, let me explain. I have a page that allows users to query a database using two drop down boxes populated dynamically the page that processes the results of this query shows the data in a table. One of the columns of this table contains data which I really want to be links to files This is what I have presently but the link doesn't work when I click it?? // mysql_fetch_array fetches the results from the query a row at a time using a while loop each time it's called // the result is returned as an array that can be referenced either by field name or by it's index while ($row = mysql_fetch_array ($result)) // loop through the rows outputing them as html table rows { // $row["fieldname"] returns the content for the field in the current row echo "<tr><td>" .$row["MANNAME"]. "</td>"; echo "<td>" .$row["prodtype"]. "</td>"; echo "<td>" .$row["proddesc"]. "</td>"; echo "<td><a href>" .$row["Compsheet"]. "</td>"; echo "<td>" .$row["prodequiv"]. "</td></tr>"; } // close html table tag echo "</table>\n"; Thanks Quote Link to comment Share on other sites More sharing options...
drewbee Posted February 27, 2008 Share Posted February 27, 2008 You just have <a href> ??? links are formatted like this: <a href="sourcedocument.html">Link text</a> Quote Link to comment Share on other sites More sharing options...
BenInBlack Posted February 27, 2008 Share Posted February 27, 2008 to expand on what drew be is saying echo "<td><a href=\"".$row["Compsheet"]."\">".$row["Compsheet"]."</a></td>"; or echo "<td><a href=\"http://www.yourdomain.com/folder/".$row["Compsheet"].".xls\">".$row["Compsheet"]."</a></td>"; Quote Link to comment Share on other sites More sharing options...
witham Posted February 27, 2008 Author Share Posted February 27, 2008 Guys thats fantastic thanks for the help I appreciate it Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.