Not sure if using a join is even the right way to go, but have been trying to use this on a page which lists products which have been filtered by the category and I wish to show the category name at the top of the page.
I have 2 tables - productcategories and products - and the content is being populated using the products table and being filtered by the ProductCategoryID with the url parameter of CategoryID (which is in the productcategories table.
So, am trying to get the CategoryName (from the productcategories table) to show as the <h1> on the page and have tried using a variety of differnt tries including (and at present) this
$query_Category = "SELECT CategoryName, products.ProductCategoryID FROM productcategories INNER JOIN products ON ProductCategoryID = CategoryName";
$Category = mysql_query($query_Category, $PowerCMSConnection) or die(mysql_error());
$row_Category = mysql_fetch_assoc($Category);
$totalRows_Category = mysql_num_rows($Category);
Clearly its not working and am getting myself all tied up trying to figure it out.
Thanks in advance