Never mind, there was nothing wrong with the code. It was another problem. The code works.
I don't know about your code because actually never ran. The product page with all the different categories like A B C D... well, each category was hyperlinking to A, It took me 30 hours to notice that. I am really dissapointed in myself, well, not really. This is my first few days of PHP, I was just so focussed on it, forgot I can still make mistakes in HTML.
Thanks for your help mate, your help has not gone in vein, believe me!
You are right about the whole point of database, but I do like my setup better and even if I didn't I would stick with it because I don't have time to learn one.