<?php $query = mysql_query("SELECT * FROM `zc_cat`"); while($array = mysql_fetch_assoc($query){ echo "<a href='/zc/dir/$array['id']'>$array['name']</a>"; } ?>