Jump to content

Recommended Posts

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>

Link to comment
https://forums.phpfreaks.com/topic/223690-linking-mysql-output-result/
Share on other sites

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>

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..

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.