Umm for one buddy your creating the table each time you run that script I'm surprised MySQL didn't kick you in the nads for that, if your going to do that at least use IF NOT EXISTS syntax so MySQL doesn't suffer.
Your reselecting the currently selected database, why?
In the SQL for CREATE TABLE why is there a period after auto_increment?
Why are you trying to open a string as a file?
I know PHP closes files automatically but you should still do it manually for good coding practice.
And
- VALUES ('$_POST['fdescription']','$imgdata1')";
The variable should be enclosed with curly brackets
- VALUES ('{$_POST['fdescription']}','$imgdata1')";
Also my best advice check out w3schools.com, tizag.com, and tutorialspoint.com and learn PHP before messing around with it especially before messing with files delete the wrong one and windows dies of course windows would reject your attempt ( or should ) but still bad idea.
Oh and if <img src="filename.php?id="imageid"> is actually your code check out w3school's excellent HTML tutorial while your there.
And one final person comment, where ever you found this tutorial don't go back there ... ever.
And I apologize if I was rude, but you need to understand PHP before jumping that far into it, believe me I know.