>[SNIP] > added and else clause. > while ($_parent != 0) > { > if > ($num_rows > 0) > { > > perform some action > } > else > { > $_parent = > "0"; > } > } > > and that solved the > problem. > > Thank you, everyone for your help. > > Curtis A small remark: I think it is good programming practice to place such static if-clauses before the while statement. This prevents a lot of redundant checks and thus saves time. Best regards, Jasper -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php