I have tried
$query_Category = "SELECT CategoryID, CategoryName, products.ProductCategoryID FROM productcategories INNER JOIN products ON ProductCategoryID = CategoryID WHERE CategoryID = %s";
and that gives me "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%s' at line 1"
I also tried
$query_Category = "SELECT CategoryID, CategoryName, products.ProductCategoryID FROM productcategories WHERE CategoryID = %s INNER JOIN products ON ProductCategoryID = CategoryID ";
which gave me "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%s INNER JOIN products ON ProductCategoryID = CategoryID' at line 1"