# PHP MySQL question...Noob!

**URL:** <https://forum.kirupa.com/t/php-mysql-question-noob/166922>\
**Category:** programming\
**Created:** [October 24, 2005, 2:12am UTC](https://forum.kirupa.com/t/php-mysql-question-noob/166922 "2005-10-24T02:12:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthewjumps](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@matthewjumps](https://forum.kirupa.com/u/matthewjumps)\
**Post date:** [October 24, 2005, 2:12am UTC](https://forum.kirupa.com/t/php-mysql-question-noob/166922/1 "2005-10-24T02:12:02Z")

</div>

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](http://link=www.foo.com%7Cwww.foo2.com%7Cwww.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?
