Categories/Sub Categories

I have a situation that I was wondering if someone might be able to walk me through…or help out

I want the user to enter a postal code… then have the option of 11 main categories…roll over the category will reveal a list of sub categories. When you click on a sub category you will be shown some company info ( for a company in that postal code in that specific sub category)

  1. The sub categories can appear in one or more main category
  2. There is only one company per sub category
  3. Show only the sub categories with a company in them

I’ve tried everything…i can’t get this to work. Is there anyone can help me with how i should set up my code and database…or know of any tutorials along these lines?

Thank you sooo much!

anyone?

If you want your list to be dynamically loaded, look for some ajax dynamic list
http://www.dhtmlgoodies.com/index.html?whichScript=ajax-dynamic-list

Ok i got some help today…but im still sort of stuck… i was told to make my tables as so…

Table : Postalcode

  1. postcode
  2. category
  3. area
  4. vendor_ref
  5. status (available/sold)

Table : Vendor

  1. vendor_ref
  2. name
  3. address
  4. phone
  5. email
  6. website

So the user has entered a postal code…been sent to this page with buttons…so I have this button…in this example exterior…and when you rollover it…i have this code to show the categories available in that particular section

<?php
session_start();
mysql_connect(“","","");
mysql_select_db("
_____”);

$sql= “SELECT * FROM postalcode
WHERE postcode = '”.$_POST[‘postcode’]."'
AND area ='exterior’
AND (status=‘sold’)";

$qry = mysql_query($sql);

if (mysql_num_rows($qry) > 0) {
while ($rs = mysql_fetch_assoc($qry)) {
print ‘<a href=“index.php?ID=1” rel=“gb_page_center[720,480]”>’.$rs[‘category’]."</a><br/><br/>";
}
} else {
echo ‘no result found’;
}
?>

What i’m stuck on is…when you click on the categories that are appearing… i want the company connected to it…to appear in a box…like a lightbox…with all the info (name, website, etc)

on the other pg(index.php?ID=1) i have the code that grabs all the information for the company…but it only works if i manually put the vendor_ref to equal something…and then all the categories have the same company.

My question is…is there any way to pass the vendor_ref from the first pg of categories to this page, so that it shows the correct company info that matches the category…or maybe there is a better way of doing this?

I hope I made sense…this is driving me crazy…just can’t get it to work!!

Thanks for the help!