Rick Tucker wrote:

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.

I think the point is more that there's no reason to have MySQL do it at all since the logic is specific to what you're doing.

$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);

If these fields are intended to be URIs, try something like (I didn't check my PHP function names; look them up first):

function LinkURI($URI)
{
$HREF = urlencode($URI);
$Text = htmlentities($URI);
return "<a href=\"$HREF\">$Text</a>";
}

print "<td align=center>".LinkURI($field)."</td>";

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



---------------------------------------------------------------------
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

Reply via email to