homepage Welcome to WebmasterWorld Guest from 54.226.180.86
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Php Mysql And How to Save Hyperlinks
Php Mysql HYPERLINKS
phil2564




msg:1250823
 8:46 pm on May 21, 2004 (gmt 0)

I have a database with on table in it the table has 5 columns one of the columns is named links I would like to be able to display a link to a persons homepage in there row.
QUESTION 1 is how do I save them in the MYSQL monitor (how do I script them in)

Question 2 Is what more do I need to add to my php script to display them if anything. BELOW IS MY PHP SCRIPT TO RETIREVE DATA.

______________________________________________________
<?php
$conn = mysql_connect("localhost","","");
mysql_select_db("models",$conn);
$person = $_POST['sex'];
$myage = $_POST['dob'];
$myheight = $_POST['size'];
$resultID = mysql_query("SELECT * FROM $person WHERE age in ($myage) and height in ($myheight) ",$conn);
print "<table border = 1><tr><th>id</th>";
print "<th>name_first</th><th>name_last</th>";
print "<th>age</th><th>height</th><th>weight</th>";
while ($row = mysql_fetch_row($resultID))
{
print "<tr>";
foreach ($row as $field)
{
print "<td>$field</td>";
}
print "</tr>";
}
print "</table>";
mysql_close($conn);
?>
______________________________________________________

Thanks for help everyone has allways been helpful.

Phil from Orlando Florida

 

VirtualOdin




msg:1250824
 4:36 pm on May 22, 2004 (gmt 0)

Phil, I am a relative newbie, but my solution is simply to store the link as text. I generally strip off the http:// at the start if it exists and put it back when I retrieve the string so as to be sure that it in a standard format.

To display the link as an active link you need a line like:

echo "<a href='http://".$yourresult."'>Some explanatory text or repeat the link text</a>";

Tim

[edited by: jatar_k at 5:03 pm (utc) on May 22, 2004]
[edit reason] no sigs thanks [/edit]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved