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
https://forums.phpfreaks.com/topic/32593-solved-names-from-mysql-into-links/
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.

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.