Jump to content

Creating dynamic links


witham

Recommended Posts

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

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>";

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.