amazing Posted April 1, 2007 Share Posted April 1, 2007 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 More sharing options...
spfoonnewb Posted April 1, 2007 Share Posted April 1, 2007 echo "<tr><td>"; echo "<a href=\"URL\">".$row['gname']."</a>"; echo "</td><td>"; Link to comment https://forums.phpfreaks.com/topic/45198-mysql-results-in-php-webpage/#findComment-219435 Share on other sites More sharing options...
amazing Posted April 1, 2007 Author Share Posted April 1, 2007 Wow! Thanks for the quick response. That worked great but since my groups have ids how would I include that: echo "<a href=\"/groups.php?id=\">".$row['gid']." Don't laugh...Strictly a newbie! Link to comment https://forums.phpfreaks.com/topic/45198-mysql-results-in-php-webpage/#findComment-219439 Share on other sites More sharing options...
spfoonnewb Posted April 1, 2007 Share Posted April 1, 2007 ? 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>"; Link to comment https://forums.phpfreaks.com/topic/45198-mysql-results-in-php-webpage/#findComment-219441 Share on other sites More sharing options...
amazing Posted April 1, 2007 Author Share Posted April 1, 2007 THANK YOU SO MUCH!!! Link to comment https://forums.phpfreaks.com/topic/45198-mysql-results-in-php-webpage/#findComment-219449 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.