SELECT command denied to user 'wacms'@'188.8.131.52' for table 'productsubcategories'
hehe! Whooho, okey, that did not work! Go back to what you had from start, and remove the repeat region for the rsShowCat. Dont think you need it.
Els do a SQL dump on the two tables you got and attach them as a text file, so i can make the right query for you, if you think you will need it in the future.