Forum Moderators: coopster

Message Too Old, No Replies

Trouble Getting PHP MYSQL query to produce hyperlinks

MYSQL Hyperlink

         

trubin

7:50 pm on Mar 21, 2009 (gmt 0)

10+ Year Member



Hi

I'm creating a site that is taking form data and querying it on the website live. I can get the data to show up, But can't seem to get the second query element_2 to show as hyperlink..

I've been out of web design for a few years and am still a little rusty.

<?php
$result = mysql_query
("SELECT * FROM ap_form_1")
or die(mysql_error());
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array($result))
{echo('<span class="heading">'.$row['element_1'].'</span><br>'.$row['element_2'].'<br><br>');}
?>
</div>
</table>

Thank You for all your help.

Ted

dreamcatcher

8:40 am on Mar 22, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Ted, welcome to WebmasterWorld. :)

How about this..

{echo('<span class="heading">'.$row['element_1'].'</span><br><a href="'.$row['element_2'].'">'.$row['element_2'].'</a><br><br>');}

dc