I have tried for hours now trying to figure out how to do this and I'm sure its impossible, I have tried the following queries and still searching for the solution.
I need to display the subcategories, subcat_title table row based on the condition the table row cat_id is equal to the cat_id row of the categories table. Its working but not how I need it to as its repeating the table row cat_title from the categories table. I'm trying to get this query to work so I can create a Mega Menu for my site.
Any help would be very appreciated.

$sql = "SELECT * FROM categories c, subcategories s WHERE c.cat_id = s.cat_id ORDER BY ABS( `cat_title` )";
$sql = "SELECT COUNT(*) as repetitions, c.cat_id, c.cat_title, s.subcat_id, s.subcat_title, s.cat_id FROM subcategories AS s INNER JOIN categories AS c ON c.cat_id=s.cat_id GROUP BY s.cat_id HAVING repetitions > 1";
$sql = "SELECT c.cat_id, c.cat_title, s.subcat_id, s.subcat_title, s.cat_id FROM subcategories AS s LEFT OUTER JOIN categories AS c ON c.cat_id = s.cat_id ORDER BY c.cat_title";

Still I am not able to understand your problem.
what kind of menu tool you are going to use.

I will be using a Mega menu and have Categories then SubCategories displayed underneath but I keep getting repeats on the category table row if you take a look at www.awholesaledirectory.com and hover over the category part on the menu you can see what I'm talking about a little better

when I opened page, I am not able to hover (no submenu displayed), so is it that the problem

I m not sure, javascript can process submitted form or not. so will will need perl in html2 for storing html1 values in hidden fields.

I m not sure, javascript can process submitted form or not. so will will need perl in html2 for storing html1 values in hidden fields.

It should show the menu when hovering over the categories tab not sure why it did not work for you maybe I was messing about with the code at the time but it does show.

Its repeating the categories table row cat_title once joined with the subcategories table.
so I get category title, then a subcategory title then it repeats its self in that way.

Rather than having a category title then a subcategory title and another subcategory title then another subcategory title.

The tables are set up like this.

(categories)
cat_id cat_title

(subcategories)
subcat_id subcat_title cat_id

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.