[thelist] splitting mysql result up into seperate words and making each a link

Dunstan Orchard dunstan at 1976design.com
Fri Sep 13 18:52:01 CDT 2002


Hi there,

more php/mysql stuff I'm afraid.



One of my db fields is a list of keywords related to an image, for example:

car, traffic, street, paper, motion, movement, america, transport



I'm currently printing this out using this method:

<?
..gubbins...
$keywords = mysql_result($result, $i,"keywords");
..gubbins...
?>

Keywords: <? print "$keywords"; ?>

You can see that example here:
http://www.1976design.com/testarea/photo/detail.php?number=4


What I'd like to do is have _each_ of those words turned into a link which
people can then click on to perform a search with that as the search term.

Would anyone be kind enough to tell me how I go about splitting those words
up, popping links around them and printing them out again seperated by commas.



Thanks for all the continuing help, I've searched phpbuilder but don't really
know how to describe this task.

cheers - dunstan

---------------------------
Dorset, England
http://www.1976design.com/
http://www.orchard.it/
http://www.maccaws.org/



More information about the thelist mailing list