I promise, this is the last one tonight :) I want to be able to pull up all the items for navigation on the left menu, then each item might have a sub item underneath it, but I only want to call them when you are on that section. The code is below. Example, when you first hit the page you will see 5 sections on the left, clicking one of them will open that page and the SUB pages under it. So, you would see Alex Scott David On the first page, click Alex and you would see: Alex Erin Scott David <? $connection = mssql_connect("parks2","sa",""); $db = mssql_select_db("wmn_test",$connection); $sql = "select bp_section_id,bp_section_name from bp_sections order by bp_section_name"; $sql_result = mssql_query($sql); while ($row = mssql_fetch_array($sql_result)){ $bp_section_id = $row["bp_section_id"]; $bp_section_name = $row["bp_section_name"]; $ln = "<tr><td><a href=\"bpsection.php?section=$bp_section_id\">$bp_section_name</a></td></tr>"; $new_data[] = $ln; }; $sqlsub = "select bps_section_id,bps_section_name from bp_sub_sections where fk_section_id ='$sectionid'"; $sql2_result = mssql_query($sqlsub); while ($row = mssql_fetch_array($sql2_result)){ $bps_section_id = $row["bps_section_id"]; $bps_section_name = $row["bps_section_name"]; $ln = "<tr><td><a href=\"bpsection.php?section=$bps_section_id\">$bps_section_name</a></td></tr>"; $new_data3[] = $ln; }; $displn1 = implode("",$new_data); $displn2 = implode("",$new_data3); $displn = ("$displn1,$displn2"); $connection = mssql_connect("parks2","sa","90Pitt!!"); $db = mssql_select_db("wmn_test",$connection); $sql = "select template_content from bp_sections inner join bp_templates on template_id = bp_sections.fk_template_id where bp_section_id = '$sectionid'"; $sql_result = mssql_query($sql); ($row = mssql_fetch_array($sql_result)); $template = $row["template_content"]; $temp = str_replace("[LEFT NAV]",$displn,$template); $temp2 = str_replace("[GRAPHIC HEADER]",$graphic_header,$temp); $temp3 = str_replace("[RIGHT CONTENT]",$right_content,$temp2); $temp4 = str_replace("[BODY GRAPHIC]",$body_graphic,$temp3); $temp5 = str_replace("[BODY DATA]",$body,$temp4); echo $temp5; ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]