dickd Posted March 27, 2006 Share Posted March 27, 2006 Hi I am new to SQL and have tried searching for a answer with no joy, I have a data base that stores members details including URL to there web site.In the query i have that displays the user details i can not see how to make the url field a click on hyperlink.I use Dreamweaver 8 for phpCan any one help me or piont me i the right direction, should i be storing them in my database differently (Varchar) or do i do something with my php page Cheers Dickd Quote Link to comment https://forums.phpfreaks.com/topic/5897-url-hyperlink/ Share on other sites More sharing options...
maexus Posted March 27, 2006 Share Posted March 27, 2006 Pretty easy, just echo the db field for the url into a html hyperlink.[code]<?phpecho <a href="'.$row['userurl'].'">$row['userurl']</a>;?>[/code]Something like that? Of course you will need to adapt it to your code. Quote Link to comment https://forums.phpfreaks.com/topic/5897-url-hyperlink/#findComment-21062 Share on other sites More sharing options...
dickd Posted March 27, 2006 Author Share Posted March 27, 2006 [!--quoteo(post=358754:date=Mar 26 2006, 10:22 PM:name=maexus)--][div class=\'quotetop\']QUOTE(maexus @ Mar 26 2006, 10:22 PM) [snapback]358754[/snapback][/div][div class=\'quotemain\'][!--quotec--]Pretty easy, just echo the db field for the url into a html hyperlink.[code]<?phpecho <a href="'.$row['userurl'].'">$row['userurl']</a>;?>[/code]Something like that? Of course you will need to adapt it to your code.[/quote]Hi my line of code read <td><span class="style12"><?php echo $row_Recordset1['Web_site']; ?></span></td>changed to <td><span class="style12"><?php echo <a href="'$row_Recordset1['Web_site']'">$row_Recordset1['Web_site']</a>; ?></span></td>I have tried a few combinatins of above but just get a line error i must have missed a quote somewhereas it says Parse error: parse error, unexpected '<', expecting ',' or ';' in /home/httpd/vhosts/......../memberdetails.php on line 148 Quote Link to comment https://forums.phpfreaks.com/topic/5897-url-hyperlink/#findComment-21089 Share on other sites More sharing options...
Guest footballkid4 Posted March 27, 2006 Share Posted March 27, 2006 Simple quotes were left outReplace this:[code]<?php echo <a href="'$row_Recordset1['Web_site']'">$row_Recordset1['Web_site']</a>; ?>[/code]With this:[code]<?php echo '<a href="'.$row_Recordset1['Web_site'].'">'.$row_Recordset1['Web_site'].'</a>'; ?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/5897-url-hyperlink/#findComment-21090 Share on other sites More sharing options...
dickd Posted March 27, 2006 Author Share Posted March 27, 2006 Cheers, now understand the order of the quotes etc many thanks Quote Link to comment https://forums.phpfreaks.com/topic/5897-url-hyperlink/#findComment-21093 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.