PHP MySQL question...Noob!

Hi all, im very new to PHP+MySQL, but i must say im enjoying it…just one question - I used the standard $result = mysql_query(“SELECT * FROM table”); stuff, and it works good when i do a while($result = mysql_fetch_assoc){} etc to spit out the data, but if i have 2 columns in my table, name and link, and i want to spit them out like this

name=HOME|CONTACT|ABOUT US link=www.foo.com|www.foo2.com|www.foo3.com

i cant seem to use the while($result = mysql_fetch_assoc){} to just do the $row[“name”] first, then make another while() loop that spits out the $row[“link”]…its like once u iterate thru the $result of a mysql_query, it cant be reused…am i right? right now my solution is to do 2 seperate querys, on for the name, another for the links…is that a more efficient way of doing it?