• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 248
  • Last Modified:

Link in MYSQL

Hi,

I am trying to write a program in PHP and MYQL, which in this program, after geting the information from Database which one one the field of Database is Link to some other pages.

How can I get this link from Database field and visitor be able to click on the link?

Thank you,
M G
0
Mohamad_111
Asked:
Mohamad_111
1 Solution
 
strolfeyCommented:
I'm a bit confused. Do you mean how do you make the data linkable?

<?php
$query="SELECT link, text FROM table";
$result=mysql_query($query);
while( $data=mysql_fetch_array($result) ) {
  echo "<a href=\"" . $data["link"] . "\">" . $data["text"] . "</a><br>\n";
}
?>

something like that..?
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now