0) order by listorder"; $result=mysql_query($sql); $num=mysql_num_rows($result); if ($num>0) { while ($i < $num) { $par2=mysql_result($result,$i,"par2"); ++$i; } $sql="SELECT * FROM $dbtable where (par2=$par2 and id!='$par2') order by listorder"; } else { $sql="SELECT * FROM $dbtable where (par2=$pageid and id!='$pageid') order by listorder"; } $result=mysql_query($sql); $num=mysql_num_rows($result); if ($num>0) { echo '
'; } $i=0; while ($i < $num) { $id=mysql_result($result,$i,"id"); $title=mysql_result($result,$i,"title"); $description=mysql_result($result,$i,"description"); $permalinks=mysql_result($result,$i,"permalinks"); ?>' title=''>0) { echo "
"; } ?>