im having problem with bullets and queries, what my script does is this: Category 1 Subcategory 1.1 Subcategory 1.2 Subcategory 2.1 Subcategory 2.2 Category 2 Subcategory 1.1 Subcategory 1.2 Subcategory 2.1 Subcategory 2.2 What I need is: Category 1 Subcategory 1.1 Subcategory 1.2 Category 2 Subcategory 2.1 Subcategory 2.2 I hope somebody can help me with this...
i do apologize for that... here is the script $current_cat=''; $current_cat2=''; #$result = mysql_query("select job_id,job_name,job_desc from job_category, subcategories where job_category.job_id = subcategories.subcategory_id") or die("SELECT Error: ".mysql_error()); $result = mysql_query("SELECT * FROM job_category") or die("SELECT Error: ".mysql_error()); while($row = mysql_fetch_assoc($result)) { if ($current_cat != $row['job_name']) { // dont print the end of the table on the first loop if(!empty($current_cat)) { echo '</table>'; } $current_cat = $row['job_name']; echo '<table width=100% border=0 cellspacing=0 cellpadding=0>'; echo '<tr><td><b>' .$row["job_name"]. '</b></td></tr>'; echo '<tr><td>' .$row["job_desc"]. '</td></tr>'; $result2 = mysql_query("SELECT * FROM job_category, subcategories WHERE job_subcat = job_id") or die(mysql_error()); while ($row2 = mysql_fetch_assoc ($result2)) { if ($current_cat2 != $row2['subcategory_name']) { // dont print the end of the table on the first loop if(!empty($current_cat2)) { echo '</table>'; } echo '<tr><td>' .$row2["subcategory_name"]. '</td></tr>'; }} echo '<tr><td> </td></tr>'; echo '</table>'; } } ?>