So a couple of things...
From a quick look it doesn't seem as if you are inserting the
$categoryimage = $_POST['categoryimage']; anywhere. It's not doing anything.
Also you are open to sql injection as your variables are unsanitized.
The way i normally tackle this is in 2 parts. Firstly i store the uploaded image on my webserver (you have to do lots of checks to make sure it is actually an image) and then once that is in place and i have the image name/address i store that in the database with the additional data. Whilst you can store the image as a blob in the database it will eventually slow it down. I prefer to link to a file. With a bit of thought you can generate 'fake' names for the image when it is called so a user won't know the actual address of the stored file.
I would suggest doing a search for an image upload script. Once you have that working create a database script to store the information you want and when that is working look at combining the 2 scripts.