HTML doesn't just see a URL and automatically make it a hyperlink it is not
"helpful" like MS products. So what you are seeing is expected behavior. I
would alter the while loop to look like this...
while ($row = mysql_fetch_array($resultID)){ #fetch_array adds little
overhead and gives you an associative array that is easy to work with
print "<tr>\n\t<td>$row[Port]</td>\n\t<td>$row[Application]</td>\n\t<td><a
href='$row[URL]' target='_blank'>$row[URL]</a></td>\n</tr>\n";
}
I do not know your column names and have assumed they are Port,Application,
and URL. I am probably wrong, put your column names in their place. By
selecting * and just looping through the fields returned you are relying on
them being returned in a certain order, while that will work, it is bad
practice. It also made the code confusing and hard to read and didn't
really save you any typing. This is just a quick solution, I did not check
the html or debug the code or look for security flaws, or put logic in place
for poorly formed URLs, you should be able to handle that.
-----Original Message-----
From: Rick Tucker [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 08, 2003 10:58 AM
To: Larry Brown
Cc: [EMAIL PROTECTED]
Subject: RE: converting text to hypertext
Larry,
This is the code I'm using. I'm pretty new to PHP, so there may be a simple
solution within PHP of which I'm unaware. I just thought it could be done
from the MySQL side of things.
$resultID = mysql_query("SELECT * FROM ports", $linkID);
print "<table><tr><th>Port #</th>";
print "<th>Transport</th><th align=center>Application</th><th
align=center>RFC/Vendor's URL/MS KB article</th>";
while ($row = mysql_fetch_row($resultID))
{
print "<tr>";
foreach ($row as $field)
{
print "<td align=center>$field</td>";
}
print "</tr>";
}
print "</table>";
mysql_close ($linkID);
Thanks,
rick
-----Original Message-----
From: Larry Brown [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 08, 2003 10:13 AM
To: Rick Tucker
Subject: RE: converting text to hypertext
The question seems to me how are you outputting to html?
Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388
-----Original Message-----
From: Rick Tucker [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 08, 2003 11:34 AM
To: [EMAIL PROTECTED]
Subject: converting text to hypertext
I just imported a .csv file and one of the columns of data was websites
addresses. Those addresses aren't being recognized as links when I output
an html table from my queries. I'm scratching me head on how to make the
conversion. I figured there would by a hypertext datatype of some sort, but
I can't find any information regarding this issue. If someone could point me
in the right direction, I would appreciate it.
Thanks,
rick
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php