RE: Hyperlinks in MySQL dB

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




-----Original Message-----
From: Gary H. Holabird [mailto:gholabird@ci.monroe.wa.us] 
Sent: Thursday, October 02, 2003 11:06 AM
To: php-db@lists.php.net
Subject: Hyperlinks in MySQL dB

This has got to be really simple & I feel really stupid having to ask
but...

I'm a very green n00b writing my first php script.

I have a VERY simple MySQL table which I would like to display a bunch
of
hyperlinks (one hyperlink per row) but I dont want the user to see the
actual webpage addresss. eg: a field will say, for instance, Title1, but
when the user clicks on it they will be directed to the page or document
described in the link.  I'm sure everybody knows how to do this.

Also, attempting the same thing, but on an Intranet with web addresses
of MS
Word docs on the network.

Thanks tons in advance.

$sql = "Select link, linktext from table";
if(!$result = mysql_query($sql)) {
	//error handling code here
}
while($row = mysql_fetch_array($result)) {
	extract($row);
	echo("<a href='$link'>$linktext</a><br>");
}

I did not test this code.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux