badeand Posted January 7, 2011 Share Posted January 7, 2011 Hi, I'm trying to make a mysql output to a link so the name will be a link so when you hit this link you will get the full information of this mysql input. Can someone point me in the correct direction? Here is how i get the output from my mysql database into my table. <td>"; echo $row['name']; echo "</td> Quote Link to comment https://forums.phpfreaks.com/topic/223690-linking-mysql-output-result/ Share on other sites More sharing options...
sooner Posted January 7, 2011 Share Posted January 7, 2011 put <a href="">$row["name']</a> tag around it. Quote Link to comment https://forums.phpfreaks.com/topic/223690-linking-mysql-output-result/#findComment-1156363 Share on other sites More sharing options...
Myoga- Posted January 7, 2011 Share Posted January 7, 2011 Hi, I'm trying to make a mysql output to a link so the name will be a link so when you hit this link you will get the full information of this mysql input. Can someone point me in the correct direction? Here is how i get the output from my mysql database into my table. <td>"; echo $row['name']; echo "</td> <td> <a href='test.php'>" . $row['name'] . "</a> </td> Quote Link to comment https://forums.phpfreaks.com/topic/223690-linking-mysql-output-result/#findComment-1156372 Share on other sites More sharing options...
Maq Posted January 7, 2011 Share Posted January 7, 2011 Something like this: echo "{$row['name']}"; Quote Link to comment https://forums.phpfreaks.com/topic/223690-linking-mysql-output-result/#findComment-1156373 Share on other sites More sharing options...
badeand Posted January 7, 2011 Author Share Posted January 7, 2011 Hi again Thanks alot for the replies, but one more question This one is working fine echo "<a href='yourlink'>{$row['name']}</a>"; But i want to query one specific record from my database. All my records have a id so when you hit the name in my table i want to get back the specific record for this name. So should "yourlink" post the id to the link? So i can use $_GET function to call the id? I'm kinda new to this, so i'm sorry if my explenation i poor.. Quote Link to comment https://forums.phpfreaks.com/topic/223690-linking-mysql-output-result/#findComment-1156429 Share on other sites More sharing options...
BlueSkyIS Posted January 7, 2011 Share Posted January 7, 2011 yes. there will be a script which will retrieve the information based on the id passed to it, let's call it details.php so the url will look like this, where id is the record id of the person. echo "<a href='details.php?id={$row['id']}'>{$row['name']}</a>"; in details.php, you'll use $_GET['id'] to get the id of the selected person. Quote Link to comment https://forums.phpfreaks.com/topic/223690-linking-mysql-output-result/#findComment-1156433 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.