Jump to content

[SOLVED] Names from MySQL into links


aztec

Recommended Posts

Hello
I have seached all of the forums on PHP Freaks to try to find the answer to the following question.
Is it possible to turn a name returned from MySQL into a link so the veiwer can click the link to go to another page, or do I need to find a different way to insert the links I need.
From what I have read it maybe a combinination of PHP, CSS and HTML may be needed if this can be achieved, I am not even sure if this post is in the correct section or not.
Any help or guidance would be gratefully received even if it says it cannot be done.
Kind Regards
Link to comment
Share on other sites

Sure you can. All you need is the HTML code:
[code]while($row = mysql_fetch_assoc($SQLRessult))
{
    echo '<a href="somepage.php?page=' . $row['nameCol']">' . $row['nameCol'] . '</a><br />';
}[/code]
That it. All you need to do is change that to your needs. If you are unsure post the current code you go here and I'll adapt it for you.
Link to comment
Share on other sites

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.