now i have posted this in script requests aswell as im not sure whether i could do it or need some help

i just need some advice or a tutorial pushing me the right way. what i need to do is get the image needs to upload to a file with a max size of 30kb not bothered what file type. i then need to rename the image to the $usersid number and insert the path in to the users table, to set image to the file path where the user id = well $userid. i hope someone can help me do this or atleast point me in a good direction.
thanks
mike