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 Link to comment https://forums.phpfreaks.com/topic/93386-creating-dynamic-links/ 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> Link to comment https://forums.phpfreaks.com/topic/93386-creating-dynamic-links/#findComment-478385 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>"; Link to comment https://forums.phpfreaks.com/topic/93386-creating-dynamic-links/#findComment-478392 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 Link to comment https://forums.phpfreaks.com/topic/93386-creating-dynamic-links/#findComment-478411 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.