Jump to content

mysql results in php webpage


amazing

Recommended Posts

This is my very first test database and I am doing a simple select row query. I want the table results to link to the actual webpage results. For example:

 

"gname" is the groups table, I want to link the result from this groups title to the groups webpage. I just don't know where to insert the <a href-- Can someone help me out please?

 

echo "<tr><td>";

echo $row['gname'];

echo "</td><td>";

Link to comment
https://forums.phpfreaks.com/topic/45198-mysql-results-in-php-webpage/
Share on other sites

?

 

echo "<tr><td>";
echo "<a href=\"groups.php?id=".$row['gid']."\">".$row['gname']."</a>";
echo "</td><td>";

 

If you want the ID, in the link name.. just add it next to it:

 

echo "<tr><td>";
echo "<a href=\"groups.php?id=".$row['gid']."\">".$row['gname']." ID: ".$row['gid']."</a>";
echo "</td><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.